Skip to content

Commit 9dfcae6

Browse files
Add code I forgot to push to #4422 (#4426)
1 parent 0a41390 commit 9dfcae6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/clusterfuzz/_internal/fuzzing/corpus_manager.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,11 @@ def get_proto_corpus(bucket_name,
659659
urls = (f'{storage.GS_PREFIX}/{bucket_name}/{url}'
660660
for url in storage.list_blobs(gcs_url))
661661

662-
if max_download_urls is not None:
663-
urls = itertools.islice(urls, max_download_urls)
664662
# TODO(metzman): Stop limiting URLs when pruning works on oss-fuzz
665663
# again.
666-
corpus_urls = dict(
667-
storage.sign_urls_for_existing_files(urls, include_delete_urls))
664+
if max_download_urls is not None:
665+
urls = itertools.islice(urls, max_download_urls)
666+
corpus_urls = dict(storage.sign_urls_for_existing_files(urls, include_delete_urls))
668667

669668
upload_urls = storage.get_arbitrary_signed_upload_urls(
670669
gcs_url, num_uploads=max_upload_urls)

src/clusterfuzz/_internal/google_cloud_utils/storage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,9 +1341,9 @@ def delete_signed_urls(urls):
13411341

13421342

13431343
def _sign_urls_for_existing_file(
1344-
corpus_element_url: str,
1345-
include_delete_urls: bool,
1344+
url_and_include_delete_urls: Tuple[str, bool],
13461345
minutes: int = SIGNED_URL_EXPIRATION_MINUTES) -> Tuple[str, str]:
1346+
corpus_element_url, include_delete_urls = url_and_include_delete_urls
13471347
download_url = get_signed_download_url(corpus_element_url, minutes)
13481348
if include_delete_urls:
13491349
delete_url = sign_delete_url(corpus_element_url, minutes)
@@ -1362,7 +1362,7 @@ def sign_urls_for_existing_files(urls,
13621362
logs.info('Signing URLs for existing files.')
13631363
args = ((url, include_delete_urls) for url in urls)
13641364
with concurrency.make_pool(cpu_bound=True, max_pool_size=2) as pool:
1365-
result = pool.map(_mappable_sign_urls_for_existing_file, args)
1365+
result = pool.map(_sign_urls_for_existing_file, args)
13661366
logs.info('Done signing URLs for existing files.')
13671367
return result
13681368

0 commit comments

Comments
 (0)