We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72fc834 commit 0016ea1Copy full SHA for 0016ea1
backend/mongo/store.go
@@ -620,10 +620,6 @@ func (s *EventStore) ensureIndexes(ctx context.Context) error {
620
if err != nil {
621
return fmt.Errorf("list existing indexes: %w", err)
622
}
623
- var indexes []bson.M
624
- if err := cur.All(ctx, &indexes); err != nil {
625
- return fmt.Errorf("index cursor: %w", err)
626
- }
627
defer cur.Close(ctx)
628
629
indexNames := make(map[string]bool)
@@ -634,6 +630,9 @@ func (s *EventStore) ensureIndexes(ctx context.Context) error {
634
630
635
631
indexNames[idx.Name] = true
636
632
633
+ if err := cur.Err(); err != nil {
+ return fmt.Errorf("cursor error: %w", err)
+ }
637
638
for _, model := range models {
639
if model.Options == nil {
0 commit comments