mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
✨ Parallel resource download workers
This commit is contained in:
@@ -130,6 +130,8 @@ You can use any of the following methods to build.
|
|||||||
| [APPRISE_URL](#apprise) | Apprise URL . | None |
|
| [APPRISE_URL](#apprise) | Apprise URL . | None |
|
||||||
| [APPRISE_NOTIFICATION_TITLE](#apprise) | Apprise Notification Title . | None |
|
| [APPRISE_NOTIFICATION_TITLE](#apprise) | Apprise Notification Title . | None |
|
||||||
| [APPRISE_NOTIFICATION_BODY](#apprise) | Apprise Notification Body . | None |
|
| [APPRISE_NOTIFICATION_BODY](#apprise) | Apprise Notification Body . | None |
|
||||||
|
| MAX_RESOURCE_WORKERS | Maximum workers for downloading resources | 3 |
|
||||||
|
|
||||||
|
|
||||||
`*` - Can be overridden for individual app.
|
`*` - Can be overridden for individual app.
|
||||||
### App Level Config
|
### App Level Config
|
||||||
|
|||||||
+1
-1
@@ -229,7 +229,7 @@ class APP(object):
|
|||||||
(name, url, config, filter_pattern) for name, url, _, filter_pattern in base_tasks
|
(name, url, config, filter_pattern) for name, url, _, filter_pattern in base_tasks
|
||||||
]
|
]
|
||||||
|
|
||||||
with ThreadPoolExecutor(1) as executor:
|
with ThreadPoolExecutor(config.max_resource_workers) as executor: # Use configurable worker count
|
||||||
futures: dict[str, concurrent.futures.Future[tuple[str, str]]] = {}
|
futures: dict[str, concurrent.futures.Future[tuple[str, str]]] = {}
|
||||||
|
|
||||||
for resource_name, raw_url, cfg, assets_filter in download_tasks:
|
for resource_name, raw_url, cfg, assets_filter in download_tasks:
|
||||||
|
|||||||
@@ -31,3 +31,4 @@ class RevancedConfig(object):
|
|||||||
self.apps = sorted(env.list("PATCH_APPS", default_build))
|
self.apps = sorted(env.list("PATCH_APPS", default_build))
|
||||||
self.global_old_key = env.bool("GLOBAL_OLD_KEY", True)
|
self.global_old_key = env.bool("GLOBAL_OLD_KEY", True)
|
||||||
self.global_space_formatted = env.bool("GLOBAL_SPACE_FORMATTED_PATCHES", True)
|
self.global_space_formatted = env.bool("GLOBAL_SPACE_FORMATTED_PATCHES", True)
|
||||||
|
self.max_resource_workers = env.int("MAX_RESOURCE_WORKERS", 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user