Skip to content

Commit

Permalink
fix(offset): allow creating offset in not existing
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Nov 23, 2022
1 parent a7bdb35 commit 65c84f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/offset/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)

const collectionName = "offsets"
Expand Down Expand Up @@ -41,6 +42,7 @@ func (s *Store) Save(ctx context.Context, offset interface{}) error {
"offset": offset,
},
},
options.Update().SetUpsert(true),
)
return err
}
Expand Down

0 comments on commit 65c84f2

Please sign in to comment.