slices index are exclusive on the right

This commit is contained in:
Andre Medeiros 2021-07-15 11:16:22 -04:00
parent a10ca40cb6
commit 8c1ed47d1a

View file

@ -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