Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
Test fix for store crash (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckrez authored and wesyoung committed Jan 26, 2019
1 parent 10b0ad5 commit 2ea3158
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cif/store/zelasticsearch/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ def create_bulk(self, token, indicators, flush=False):
ii = self.create(token, i, bulk=True)
actions.append(ii)

helpers.bulk(self.handle, actions, index=self._current_index())
try:
helpers.bulk(self.handle, actions, index=self._current_index())

except Exception as e:
logger.error(e)
actions = []

if flush:
self.flush()
Expand Down Expand Up @@ -292,4 +297,3 @@ def upsert(self, token, indicators, flush=False):

#self.lockm.lock_release()
return count

0 comments on commit 2ea3158

Please sign in to comment.