Skip to content
Snippets Groups Projects
Commit 574904a5 authored by Simon Esposito's avatar Simon Esposito
Browse files

Minor fix

parent 3b339e2c
Branches
No related tags found
No related merge requests found
...@@ -70,7 +70,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa ...@@ -70,7 +70,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa
} }
// Deliver live notifications to connected users. // Deliver live notifications to connected users.
go func() {
for userID, ns := range notifications { for userID, ns := range notifications {
messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{ messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{
Message: &rtapi.Envelope_Notifications{ Message: &rtapi.Envelope_Notifications{
...@@ -80,7 +79,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa ...@@ -80,7 +79,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa
}, },
}, true) }, true)
} }
}()
return nil return nil
} }
...@@ -196,7 +194,7 @@ func NotificationList(ctx context.Context, logger *zap.Logger, db *sql.DB, userI ...@@ -196,7 +194,7 @@ func NotificationList(ctx context.Context, logger *zap.Logger, db *sql.DB, userI
cursorQuery := " " cursorQuery := " "
if nc != nil && nc.NotificationID != nil { if nc != nil && nc.NotificationID != nil {
cursorQuery = " AND (user_id, create_time, id) > ($1::UUID, $3::TIMESTAMPTZ, $4::UUID)" 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, ` rows, err := db.QueryContext(ctx, `
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment