1
This commit is contained in:
@@ -10,6 +10,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from app.dependencies import get_current_user, get_db
|
||||
from app.models.user import User
|
||||
from app.enums.common import ModuleProjectStatusEnum
|
||||
from app.enums.generation_task import GenerationOwnerType
|
||||
from app.enums.hot_opening_replicate import HotOpeningLogEventEnum, HotOpeningStepCodeEnum, ModuleCodeEnum
|
||||
from app.schemas.hot_opening_replicate import (
|
||||
HotOpeningActionOut,
|
||||
@@ -610,14 +611,21 @@ async def generate_image(
|
||||
from app.tasks.generation_create_tasks import chatapi_create_generation_task
|
||||
|
||||
try:
|
||||
chatapi_create_generation_task.delay(chat_task_id_value)
|
||||
chatapi_create_generation_task.apply_async(
|
||||
args=[chat_task_id_value],
|
||||
kwargs={"owner_type": GenerationOwnerType.CHAT_GENERATION_TASK.value, "generation_attempt_no": 1},
|
||||
queue="gen_chatapi_create",
|
||||
countdown=0,
|
||||
)
|
||||
except Exception as exc:
|
||||
await _mark_dispatch_failed_and_raise(
|
||||
db,
|
||||
_log_api_error(
|
||||
event_type=HotOpeningLogEventEnum.CELERY_DISPATCH_FAILED.value,
|
||||
current_user=current_user,
|
||||
project_id=project_id_value,
|
||||
step_id=step_id_value,
|
||||
message=f"图片生成任务投递失败: {exc}",
|
||||
message=f"图片生成任务投递失败,等待生成恢复任务补投: {exc}",
|
||||
detail={"recoverable": True, "chat_task_id": chat_task_id_value},
|
||||
exc=exc,
|
||||
)
|
||||
|
||||
return HotOpeningActionOut(
|
||||
@@ -747,14 +755,21 @@ async def generate_video(
|
||||
from app.tasks.generation_create_tasks import chatapi_create_generation_task
|
||||
|
||||
try:
|
||||
chatapi_create_generation_task.delay(chat_task_id_value)
|
||||
chatapi_create_generation_task.apply_async(
|
||||
args=[chat_task_id_value],
|
||||
kwargs={"owner_type": GenerationOwnerType.CHAT_GENERATION_TASK.value, "generation_attempt_no": 1},
|
||||
queue="gen_chatapi_create",
|
||||
countdown=0,
|
||||
)
|
||||
except Exception as exc:
|
||||
await _mark_dispatch_failed_and_raise(
|
||||
db,
|
||||
_log_api_error(
|
||||
event_type=HotOpeningLogEventEnum.CELERY_DISPATCH_FAILED.value,
|
||||
current_user=current_user,
|
||||
project_id=project_id_value,
|
||||
step_id=step_id_value,
|
||||
message=f"视频生成任务投递失败: {exc}",
|
||||
message=f"视频生成任务投递失败,等待生成恢复任务补投: {exc}",
|
||||
detail={"recoverable": True, "chat_task_id": chat_task_id_value},
|
||||
exc=exc,
|
||||
)
|
||||
|
||||
return HotOpeningActionOut(
|
||||
|
||||
Reference in New Issue
Block a user