From 8c1ed47d1a8e50416235e4672a0259ddb8e888b5 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 15 Jul 2021 11:16:22 -0400 Subject: [PATCH] slices index are exclusive on the right --- internal/worker/notifications.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/worker/notifications.go b/internal/worker/notifications.go index 055fec3..491308f 100644 --- a/internal/worker/notifications.go +++ b/internal/worker/notifications.go @@ -276,7 +276,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) { oldest = i } - tt := msgs.Children[:oldest] + tt := msgs.Children[:oldest+1] nc.logger.WithFields(logrus.Fields{ "accountID": id, @@ -285,6 +285,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) { // Set latest message we alerted on latestMsg := tt[0] + if err = nc.db.BeginFunc(ctx, func(tx pgx.Tx) error { stmt := ` UPDATE accounts