mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[download_from_google_storage] Add envvar for num_threads
R=engeg@google.com Change-Id: Iedfa8b1fb18a8687c134867d8db6ca9f738bb4ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5100054 Reviewed-by: George Engelbrecht <engeg@google.com> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -537,7 +537,7 @@ def main(args):
|
||||
'Must be used with -d/--directory')
|
||||
parser.add_option('-t',
|
||||
'--num_threads',
|
||||
default=1,
|
||||
default=0,
|
||||
type='int',
|
||||
help='Number of downloader threads to run.')
|
||||
parser.add_option('-d',
|
||||
@@ -661,6 +661,10 @@ def main(args):
|
||||
'--sha1_file or --directory')
|
||||
|
||||
input_filename = args[0]
|
||||
num_threads = options.num_threads
|
||||
if not num_threads:
|
||||
num_threads = max(
|
||||
int(os.environ.get('DOWNLOAD_FROM_GOOGLE_STORAGE_THREADS', 1)), 1)
|
||||
|
||||
# Set output filename if not specified.
|
||||
if not options.output and not options.directory:
|
||||
@@ -684,8 +688,8 @@ def main(args):
|
||||
|
||||
try:
|
||||
return download_from_google_storage(
|
||||
input_filename, base_url, gsutil, options.num_threads,
|
||||
options.directory, options.recursive, options.force, options.output,
|
||||
input_filename, base_url, gsutil, num_threads, options.directory,
|
||||
options.recursive, options.force, options.output,
|
||||
options.ignore_errors, options.sha1_file, options.verbose,
|
||||
options.auto_platform, options.extract)
|
||||
except FileNotFoundError as e:
|
||||
|
||||
Reference in New Issue
Block a user