From 574904a50267f380b66147d27d4e65cc2bd5b03e Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Thu, 10 Aug 2023 17:40:25 +0100 Subject: [PATCH] Minor fix --- server/core_notification.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/server/core_notification.go b/server/core_notification.go index 93fd0000c..be4db1093 100644 --- a/server/core_notification.go +++ b/server/core_notification.go @@ -70,17 +70,15 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa } // Deliver live notifications to connected users. - go func() { - for userID, ns := range notifications { - messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{ - Message: &rtapi.Envelope_Notifications{ - Notifications: &rtapi.Notifications{ - Notifications: ns, - }, + for userID, ns := range notifications { + messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{ + Message: &rtapi.Envelope_Notifications{ + Notifications: &rtapi.Notifications{ + Notifications: ns, }, - }, true) - } - }() + }, + }, true) + } return nil } @@ -196,7 +194,7 @@ func NotificationList(ctx context.Context, logger *zap.Logger, db *sql.DB, userI cursorQuery := " " if nc != nil && nc.NotificationID != nil { cursorQuery = " AND (user_id, create_time, id) > ($1::UUID, $3::TIMESTAMPTZ, $4::UUID)" - params = append(params, &pgtype.Timestamptz{Time: time.Unix(0, nc.CreateTime).UTC(), Valid: true}, uuid.FromBytesOrNil(nc.NotificationID)) + params = append(params, time.Unix(0, nc.CreateTime).UTC(), uuid.FromBytesOrNil(nc.NotificationID)) } rows, err := db.QueryContext(ctx, ` -- GitLab