feat: tune cmhub image timeouts

This commit is contained in:
chengma
2026-07-08 11:22:47 +08:00
parent 2970aaa943
commit 46afae4b98
7 changed files with 79 additions and 19 deletions
+11 -2
View File
@@ -88,7 +88,7 @@ class SettingsTab(QWidget):
self.cmhub_connect_timeout_spin = QSpinBox()
self.cmhub_connect_timeout_spin.setObjectName("cmhubConnectTimeoutSpin")
self.cmhub_connect_timeout_spin.setRange(1, 3600)
self.cmhub_connect_timeout_spin.setValue(10)
self.cmhub_connect_timeout_spin.setValue(appconfig.CMHUB_CONNECT_TIMEOUT_DEFAULT)
self.cmhub_check_balance_checkbox = QCheckBox("批量生成前检查余额")
self.cmhub_check_balance_checkbox.setObjectName("cmhubCheckBalanceCheckbox")
self.cmhub_refresh_button = QPushButton("刷新别名")
@@ -825,7 +825,16 @@ class SettingsTab(QWidget):
self._loaded_cmhub_api_key = appconfig.get_cmhub_api_key(path=self.cmhub_config_path)
self.cmhub_api_key_edit.setText(self._loaded_cmhub_api_key)
self.cmhub_connect_timeout_spin.setValue(
max(1, int(cmhub_cfg.get("connect_timeout", 10) or 10))
max(
1,
int(
cmhub_cfg.get(
"connect_timeout",
appconfig.CMHUB_CONNECT_TIMEOUT_DEFAULT,
)
or appconfig.CMHUB_CONNECT_TIMEOUT_DEFAULT
),
)
)
self.cmhub_check_balance_checkbox.setChecked(
bool(cmhub_cfg.get("check_balance_before_batch", False))