Skip to content

Commit

Permalink
use sync map 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-goodisman committed Apr 24, 2024
1 parent 257798e commit ef62f07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/oplog/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func closeCursor(cursor *mongo.Cursor) {
//
// The timestamp of the entry is returned so that tailOnce knows the timestamp of the last entry it read, even if it
// ignored it or failed at some later step.
func (tailer *Tailer) unmarshalEntry(rawData bson.Raw, denylist *map[string]bool) (timestamp *primitive.Timestamp, pubs []*redispub.Publication) {
func (tailer *Tailer) unmarshalEntry(rawData bson.Raw, denylist *sync.Map) (timestamp *primitive.Timestamp, pubs []*redispub.Publication) {
var result rawOplogEntry

err := bson.Unmarshal(rawData, &result)
Expand Down Expand Up @@ -365,7 +365,7 @@ func (tailer *Tailer) unmarshalEntry(rawData bson.Raw, denylist *map[string]bool
database = entries[0].Database
}

if _, denied := (*denylist)[database]; denied {
if _, denied := denylist.Load(database); denied {
log.Log.Debugw("Skipping oplog entry", "database", database)
return
}
Expand Down

0 comments on commit ef62f07

Please sign in to comment.