爆款开头复刻/拆镜复刻追加日志|拆镜复刻追加视频AI分析API
This commit is contained in:
@@ -98,6 +98,11 @@ def _lease_seconds() -> int:
|
||||
return max(1, int(settings.MODULE_ASYNC_LEASE_SECONDS or 600))
|
||||
|
||||
|
||||
def _shot_analysis_lease_seconds() -> int:
|
||||
timeout = max(1, int(getattr(settings, "SHOT_ANALYSIS_TIMEOUT_SECONDS", 600) or 600))
|
||||
return max(_lease_seconds(), timeout + 120)
|
||||
|
||||
|
||||
def _queue_timeout_seconds() -> int:
|
||||
return max(1, int(settings.MODULE_ASYNC_QUEUE_TIMEOUT_SECONDS or 300))
|
||||
|
||||
@@ -227,7 +232,7 @@ async def register_shot_task_set_analysis_task(task_set_id: str) -> str:
|
||||
module=SHOT_MODULE,
|
||||
project_id=task_set_id,
|
||||
task_set_id=task_set_id,
|
||||
check_after_seconds=_lease_seconds(),
|
||||
check_after_seconds=_shot_analysis_lease_seconds(),
|
||||
)
|
||||
|
||||
|
||||
@@ -242,7 +247,7 @@ async def register_shot_segment_analysis_task(segment_id: str, *, task_set_id: s
|
||||
project_id=task_set_id,
|
||||
task_set_id=task_set_id,
|
||||
segment_id=segment_id,
|
||||
check_after_seconds=_lease_seconds(),
|
||||
check_after_seconds=_shot_analysis_lease_seconds(),
|
||||
)
|
||||
|
||||
|
||||
@@ -297,10 +302,15 @@ async def postpone_active_task(
|
||||
|
||||
|
||||
async def mark_active_started(*, object_type: str, object_id: str, reason: str = "started") -> None:
|
||||
delay_seconds = _lease_seconds()
|
||||
if object_type in {OBJECT_SHOT_TASK_SET_ANALYSIS, OBJECT_SHOT_SEGMENT_ANALYSIS}:
|
||||
delay_seconds = _shot_analysis_lease_seconds()
|
||||
elif object_type == OBJECT_SHOT_SPLIT_SEGMENT:
|
||||
delay_seconds = max(_lease_seconds(), int(settings.SHOT_SPLIT_LEASE_SECONDS or 600))
|
||||
await postpone_active_task(
|
||||
object_type=object_type,
|
||||
object_id=object_id,
|
||||
delay_seconds=_lease_seconds(),
|
||||
delay_seconds=delay_seconds,
|
||||
reason=reason,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user