Skip to content

Commit

Permalink
checked for conflicts in file hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
julius-heitkoetter authored Oct 13, 2023
1 parent 623c229 commit 2a65ff0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions A2rchi/utils/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ def _add_to_vectorstore(self, collection, files_to_add, sources={}):
time_identifier = hashlib.md5()
time_identifier.update(str(time.time()).encode('utf-8'))
time_hash = str(int(identifier.hexdigest(),16))[0:6]
while str(filehash) + str(chunk_hash) + str(time_hash) in ids:
print("INFO: Found conflict with hash: " + str(filehash) + str(chunk_hash) + str(time_hash) + ". Trying again")
time_hash += 1
ids.append(str(filehash) + str(chunk_hash) + str(time_hash))

print("Ids: ",ids)
Expand Down

0 comments on commit 2a65ff0

Please sign in to comment.