Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nkitlabs committed Jun 6, 2024
1 parent f60c0c8 commit 6710d89
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion subscriber/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ func (s *Subscriber) listenEvents(
}

s.logger.Debug("New event", "uid: %s", uid)
s.cache.Add(key, struct{}{}, cache.DefaultExpiration)

// Add the event to the cache, it should never return error due to a new item
// but we log it just in case.
if err := s.cache.Add(key, struct{}{}, cache.DefaultExpiration); err != nil {
s.logger.Error("Failed to add event to cache", "error", err)
continue
}

out <- msg
case <-stopCh:
break
Expand Down

0 comments on commit 6710d89

Please sign in to comment.