mirror of
https://github.com/ihmily/StreamCap.git
synced 2026-05-07 22:15:58 +08:00
feat: add configurable max concurrent requests per platform
This commit is contained in:
@@ -28,7 +28,8 @@ class RecordingManager:
|
||||
self._ = {}
|
||||
self.load()
|
||||
self.initialize_dynamic_state()
|
||||
self.platform_semaphores = defaultdict(lambda: asyncio.Semaphore(3))
|
||||
max_concurrent = int(self.settings.user_config.get("platform_max_concurrent_requests", 3))
|
||||
self.platform_semaphores = defaultdict(lambda: asyncio.Semaphore(max_concurrent))
|
||||
|
||||
@property
|
||||
def recordings(self):
|
||||
|
||||
@@ -443,6 +443,16 @@ class SettingsPage(PageBase):
|
||||
on_change=self.on_change,
|
||||
),
|
||||
),
|
||||
self.create_setting_row(
|
||||
self._["platform_max_concurrent_requests"],
|
||||
ft.TextField(
|
||||
value=str(self.get_config_value("platform_max_concurrent_requests", 3)),
|
||||
width=100,
|
||||
data="platform_max_concurrent_requests",
|
||||
on_change=self.on_change,
|
||||
hint_text=self._["platform_max_concurrent_requests_tip"]
|
||||
),
|
||||
),
|
||||
],
|
||||
is_mobile,
|
||||
),
|
||||
|
||||
@@ -60,5 +60,6 @@
|
||||
"recipient_email": "",
|
||||
"theme_color": "blue",
|
||||
"is_grid_view": true,
|
||||
"theme_mode": "light"
|
||||
"theme_mode": "light",
|
||||
"platform_max_concurrent_requests": "3"
|
||||
}
|
||||
@@ -353,7 +353,9 @@
|
||||
"switch_video_format": "Switch video recording format",
|
||||
"switch_recording_quality": "Switch video recording quality",
|
||||
"switch_account_type": "Switch account type",
|
||||
"switch_language_tip": "Tip: It is recommended to restart the program after switching languages"
|
||||
"switch_language_tip": "Tip: It is recommended to restart the program after switching languages",
|
||||
"platform_max_concurrent_requests": "Max concurrent recordings per platform",
|
||||
"platform_max_concurrent_requests_tip": "The maximum number of concurrent requests allowed per platform. Default is 3."
|
||||
},
|
||||
"about_page": {
|
||||
"about_project": "About This Application",
|
||||
|
||||
@@ -355,7 +355,9 @@
|
||||
"switch_video_format": "切换视频录制格式",
|
||||
"switch_recording_quality": "切换视频录制质量",
|
||||
"switch_account_type": "切换账号类型",
|
||||
"switch_language_tip": "提示: 建议切换语言后重启程序"
|
||||
"switch_language_tip": "提示: 建议切换语言后重启程序",
|
||||
"platform_max_concurrent_requests": "平台最大并发录制数",
|
||||
"platform_max_concurrent_requests_tip": "每个平台允许同时发起请求的最大并发数,默认3"
|
||||
},
|
||||
"about_page": {
|
||||
"about_project": "关于本程序",
|
||||
|
||||
Reference in New Issue
Block a user