Skip to content

Commit

Permalink
Merge pull request #26 from sendbird/bugfix/update-last-pk-inserted-o…
Browse files Browse the repository at this point in the history
…n-duplicate-key

Fix bug on duplicate key
  • Loading branch information
jjh-kim authored Nov 17, 2024
2 parents 42b071f + af8fa29 commit 38d9d9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sbosc/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def bulk_import(self):
start_pk = self.get_start_pk(chunk_info)
if start_pk is None:
return
# If the start_pk is greater than the end_pk, set the last_pk_inserted to end_pk
# This can happen when chunk ended with a duplicate key error
elif start_pk > chunk_info.end_pk:
chunk_info.last_pk_inserted = chunk_info.end_pk

end_pk = chunk_info.end_pk
chunk_info.status = ChunkStatus.IN_PROGRESS
Expand Down

0 comments on commit 38d9d9a

Please sign in to comment.