fix: align cmhub image timeout display
This commit is contained in:
@@ -38,6 +38,7 @@ class CMHubError(AIError):
|
||||
|
||||
CMHUB_IMAGE_MAX_BYTES = 20 * 1024 * 1024
|
||||
CMHUB_TITLE_READ_TIMEOUT_SECONDS = 600
|
||||
CMHUB_IMAGE_READ_TIMEOUT_SECONDS = 650
|
||||
|
||||
_RESOLUTION_SIZES = {
|
||||
"512": (512, 512),
|
||||
@@ -766,15 +767,7 @@ def _normalize_cmhub_resolution(resolution):
|
||||
|
||||
|
||||
def _cmhub_read_timeout(config, resolution):
|
||||
try:
|
||||
timeout = int(appconfig.response_timeout(config))
|
||||
except Exception:
|
||||
timeout = 600
|
||||
resolution_key = str(resolution or "").strip().lower()
|
||||
timeouts = appconfig.ai_config(config).get("resolution_timeouts", {})
|
||||
if resolution_key in timeouts:
|
||||
timeout = int(timeouts[resolution_key])
|
||||
return min(600, max(1, timeout))
|
||||
return CMHUB_IMAGE_READ_TIMEOUT_SECONDS
|
||||
|
||||
|
||||
def _cmhub_call_with_retry(
|
||||
|
||||
Reference in New Issue
Block a user