Skip to content

Commit

Permalink
driver-dispatch-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
foxish committed Jul 3, 2024
1 parent f5bfcbc commit 34c1f93
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions services/driver/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ func (consumer *Consumer) processDispatchRequest(msg *sarama.ConsumerMessage) {
}

// get the driver with the best ETA
bestDriver, err := consumer.bestETA.Get(ctx, &dispatchReq, drivers)
_, err = consumer.bestETA.Get(ctx, &dispatchReq, drivers)
if err != nil {
consumer.logger.For(ctx).Error("error calculating best route", zap.Error(err))
span.SetStatus(codes.Error, err.Error())
return
}

// send a notification
consumer.notification.Store(ctx, &notifications.Notification{
ID: fmt.Sprintf("req-%d-dispatched-driver", reqContext.ID),
Timestamp: time.Now(),
Context: notificationCtx,
Body: fmt.Sprintf("Driver %s arriving in %s", bestDriver.DriverID, bestDriver.ETA.String()),
})
// consumer.notification.Store(ctx, &notifications.Notification{
// ID: fmt.Sprintf("req-%d-dispatched-driver", reqContext.ID),
// Timestamp: time.Now(),
// Context: notificationCtx,
// Body: fmt.Sprintf("Driver %s arriving in %s", bestDriver.DriverID, bestDriver.ETA.String()),
// })
}

0 comments on commit 34c1f93

Please sign in to comment.