Skip to content

Commit

Permalink
Check return value of lock
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed May 28, 2024
1 parent f3a7d12 commit 9bcd0ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/mls/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ func (s *Store) PublishIdentityUpdate(ctx context.Context, req *identity.Publish
inboxId := newUpdate.GetInboxId()
// We use a pg_advisory_lock to lock the inbox_id instead of SELECT FOR UPDATE
// This allows the lock to be enforced even when there are no existing `inbox_log`s
txQueries.LockInboxLog(ctx, inboxId)
if err := txQueries.LockInboxLog(ctx, inboxId); err != nil {
return err
}

log := s.log.With(zap.String("inbox_id", inboxId))
inboxLogEntries, err := txQueries.GetAllInboxLogs(ctx, inboxId)
if err != nil {
Expand Down

0 comments on commit 9bcd0ad

Please sign in to comment.