Skip to content

Commit

Permalink
remove duplicate in list_check_sha1s
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 9, 2019
1 parent 45f45be commit 1228a19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cufacesearch/cufacesearch/updater/extraction_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ def run(self, daemon=False):
raise ValueError('Unknown keys in msg: {}'.format(msg.keys()))
# This is dangerous, as it assumes the self.ingester.get_msg_json() generator
# would restart from the next point... Is this the case for Kafka?
prev_len = len(list_check_sha1s)
list_check_sha1s = list(set(list_check_sha1s))
if len(list_check_sha1s) < prev_len:
msg = "[{}: log] Removed {} duplicate from `list_check_sha1s`"
print(msg.format(self.pp, prev_len - len(list_check_sha1s)))
if len(list_check_sha1s) >= self.indexer.batch_update_size:
break
except Exception as inst:
Expand Down

0 comments on commit 1228a19

Please sign in to comment.