Merge pull request #851 from tcely/patch-18

Base request delay on the number of tasks running
This commit is contained in:
meeb authored and GitHub committed 2025-03-17 15:24:28 +11:00
commit e8887f3f97
1 file changed
+2 -2
+2 -2
View File
@@ -169,7 +169,7 @@ def get_media_info(url, days=None):
'youtubetab': {'approximate_date': ['true']}, 'youtubetab': {'approximate_date': ['true']},
}, },
'paths': paths, 'paths': paths,
'sleep_interval_requests': 2, 'sleep_interval_requests': 2 * settings.BACKGROUND_TASK_ASYNC_THREADS,
'verbose': True if settings.DEBUG else False, 'verbose': True if settings.DEBUG else False,
}) })
if start: if start:
@@ -281,7 +281,7 @@ def download_media(
'overwrites': None, 'overwrites': None,
'sleep_interval': 10 + int(settings.DOWNLOAD_MEDIA_DELAY / 20), 'sleep_interval': 10 + int(settings.DOWNLOAD_MEDIA_DELAY / 20),
'max_sleep_interval': settings.DOWNLOAD_MEDIA_DELAY, 'max_sleep_interval': settings.DOWNLOAD_MEDIA_DELAY,
'sleep_interval_requests': 5, 'sleep_interval_requests': 1 + (2 * settings.BACKGROUND_TASK_ASYNC_THREADS),
'paths': opts.get('paths', dict()), 'paths': opts.get('paths', dict()),
'postprocessor_args': opts.get('postprocessor_args', dict()), 'postprocessor_args': opts.get('postprocessor_args', dict()),
'postprocessor_hooks': opts.get('postprocessor_hooks', list()), 'postprocessor_hooks': opts.get('postprocessor_hooks', list()),