Skip to content

Commit

Permalink
Merge pull request #40 from gisce/index_try
Browse files Browse the repository at this point in the history
Add try/except to idex creation
  • Loading branch information
polsala authored Oct 23, 2024
2 parents 6d6da75 + 13d03e5 commit f00b664
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sippers/backends/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ def index_tables(self):
sips_table.append([model.collection, model.collection_index, model.index_unic])

for table in sips_table:
self.db[table[0]].ensure_index(
table[1], unique=table[2], background=True
)
try:
self.db[table[0]].ensure_index(
table[1], unique=table[2], background=True
)
except Exception as e:
print e

def insert(self, document):
batch_insert = False
Expand Down

0 comments on commit f00b664

Please sign in to comment.