Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit cc41714

Browse files
committed
Use bucket.delete_blobs instead of deleting blobs individually
1 parent a3b49f4 commit cc41714

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

samples/snippets/export_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _create_sink_name():
5050

5151

5252
@backoff.on_exception(backoff.expo, Exception, max_time=60, raise_on_giveup=False)
53-
def _delete_object(obj):
53+
def _delete_object(obj, force=False):
5454
obj.delete()
5555

5656

@@ -80,8 +80,7 @@ def cleanup_old_sinks():
8080
bucket_timestamp = int(match.group(1))
8181
if TIMESTAMP - bucket_timestamp // 1000 > CLEANUP_THRESHOLD:
8282
# Delete all blobs in the bucket before deleting the bucket.
83-
for blob in bucket.list_blobs():
84-
_delete_object(blob)
83+
bucket.delete_blobs(bucket.list_blobs())
8584
_delete_object(bucket)
8685

8786

0 commit comments

Comments
 (0)