from typing import Any from app.application.feishu.inbound import ( process_due_feishu_inbound_events, process_feishu_inbound_event, ) from app.core.constants import ActorValue from app.modules.feishu.constants import FEISHU_INBOUND_BATCH_SIZE from app.tasks.app import celery_app from app.tasks.constants import ( TASK_PROCESS_DUE_FEISHU_INBOUND, TASK_PROCESS_FEISHU_INBOUND, ) @celery_app.task(name=TASK_PROCESS_FEISHU_INBOUND) def process_feishu_inbound_event_task( event_key: str, actor: str = ActorValue.WORKER, ) -> dict[str, Any]: return process_feishu_inbound_event(event_key, actor=actor) @celery_app.task(name=TASK_PROCESS_DUE_FEISHU_INBOUND) def process_due_feishu_inbound_events_task( limit: int = FEISHU_INBOUND_BATCH_SIZE, actor: str = ActorValue.WORKER, ) -> list[dict[str, Any]]: return process_due_feishu_inbound_events(limit=limit, actor=actor)