From 34c1f9377f6f75c5bbe584b66db1f3f6f77fd252 Mon Sep 17 00:00:00 2001 From: Anirudh Ramanathan Date: Wed, 3 Jul 2024 07:59:00 -0700 Subject: [PATCH] driver-dispatch-bug --- services/driver/consumer.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/driver/consumer.go b/services/driver/consumer.go index 72951be..ff09979 100644 --- a/services/driver/consumer.go +++ b/services/driver/consumer.go @@ -151,7 +151,7 @@ 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()) @@ -159,10 +159,10 @@ func (consumer *Consumer) processDispatchRequest(msg *sarama.ConsumerMessage) { } // send a notification - consumer.notification.Store(ctx, ¬ifications.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, ¬ifications.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()), + // }) }