@danhachuel/thunderbolt 0.6.77 → 0.6.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hermes_ui/pipeline_worker.py +16 -2
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ PIPELINE_LOG_FILENAME = "pipeline_worker.json"
|
|
|
41
41
|
VIDEO_TIMEOUT_SECONDS = 20 * 60
|
|
42
42
|
LONG_STOCK_VIDEO_TIMEOUT_SECONDS = 90 * 60
|
|
43
43
|
VIDEO_IDLE_TIMEOUT_SECONDS = 10 * 60
|
|
44
|
+
STOCK_VIDEO_IDLE_TIMEOUT_SECONDS = 30 * 60
|
|
44
45
|
STALE_TASK_SECONDS = VIDEO_TIMEOUT_SECONDS + 5 * 60
|
|
45
46
|
WORKER_HEARTBEAT_TIMEOUT_SECONDS = 15
|
|
46
47
|
CASCADE_STAGE_ORDER = ("topic", "script", "title", "keywords", "video", "thumbnail_prompt", "thumbnail", "upload")
|
|
@@ -726,6 +727,18 @@ def _video_timeout_seconds(task: dict[str, Any], settings: dict[str, Any] | None
|
|
|
726
727
|
return VIDEO_TIMEOUT_SECONDS
|
|
727
728
|
|
|
728
729
|
|
|
730
|
+
def _video_idle_timeout_seconds(task: dict[str, Any], settings: dict[str, Any] | None = None) -> int:
|
|
731
|
+
"""Allow slow stock downloads to stay quiet without treating them as hung."""
|
|
732
|
+
configured = VIDEO_IDLE_TIMEOUT_SECONDS
|
|
733
|
+
if configured <= 0:
|
|
734
|
+
return configured
|
|
735
|
+
effective_settings = settings if isinstance(settings, dict) else _settings()
|
|
736
|
+
route = _normalise_video_route(task, effective_settings)
|
|
737
|
+
if route in {"pexels", "pixabay"}:
|
|
738
|
+
return max(configured, STOCK_VIDEO_IDLE_TIMEOUT_SECONDS)
|
|
739
|
+
return configured
|
|
740
|
+
|
|
741
|
+
|
|
729
742
|
def _task_stale_timeout_seconds(task: dict[str, Any]) -> int:
|
|
730
743
|
"""Keep stale-task recovery aligned with the actual execution budget."""
|
|
731
744
|
if str(task.get("stage") or "").strip().casefold() == "video":
|
|
@@ -1032,6 +1045,7 @@ def _run_video_helper_once(
|
|
|
1032
1045
|
line_queue: queue.Queue[str | None] = queue.Queue()
|
|
1033
1046
|
started_at = time.monotonic()
|
|
1034
1047
|
timeout_seconds = _video_timeout_seconds(task, settings)
|
|
1048
|
+
idle_timeout_seconds = _video_idle_timeout_seconds(task, settings)
|
|
1035
1049
|
process: subprocess.Popen[str] | None = None
|
|
1036
1050
|
|
|
1037
1051
|
def _read_output() -> None:
|
|
@@ -1125,11 +1139,11 @@ def _run_video_helper_once(
|
|
|
1125
1139
|
failure_metadata=metadata,
|
|
1126
1140
|
fallback_eligible=True,
|
|
1127
1141
|
)
|
|
1128
|
-
if time.monotonic() - last_activity_at >=
|
|
1142
|
+
if time.monotonic() - last_activity_at >= idle_timeout_seconds:
|
|
1129
1143
|
_stop_process(process)
|
|
1130
1144
|
message = (
|
|
1131
1145
|
"A etapa Vídeo não apresentou actividade comprovada do motor durante "
|
|
1132
|
-
f"{
|
|
1146
|
+
f"{idle_timeout_seconds // 60} minutos e foi encerrada."
|
|
1133
1147
|
)
|
|
1134
1148
|
metadata = _failure_attribution(task, settings, "video", error=message)
|
|
1135
1149
|
raise PipelineError(
|
package/package.json
CHANGED