Skip to content

Commit

Permalink
fix(daemons/transfer.py): fixed ids deletion (#135)
Browse files Browse the repository at this point in the history
Reduced the amount of ids deleted at the same time due to URI too long.
  • Loading branch information
odarotto authored Oct 18, 2024
1 parent bc75993 commit c28f41e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion workflow/daemons/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ def perform(

if delete:
logger.info(f"deleting {len(delete)} works from buckets")
http.buckets.delete_ids(delete)
if len(delete) > 100:
for batch in range(0, len(delete), 100):
http.buckets.delete_ids(delete[batch : batch + 100])
else:
http.buckets.delete_ids(delete)
logger.info(f"transferred {transfered}, deleted {len(delete)} works")
return {
"transfered": transfered,
Expand Down

0 comments on commit c28f41e

Please sign in to comment.