123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- class Const:
- # task status
- TASK_INIT_STATUS = 0
- TASK_PROCESSING_STATUS = 1
- TASK_SUCCESS_STATUS = 2
- TASK_FAILED_STATUS = 3
- # DEFAULT
- DEFAULT_TIMEOUT = 1800
- # duration
- CHECK_KIMI_BALANCE_TIMEOUT = 20
- GET_OFF_VIDEO_TIMEOUT = 1800
- CHECK_VIDEO_AUDIT_TIMEOUT = 1800
- OUTSIDE_ARTICLE_MONITOR_TIMEOUT = 3 * 3600
- INNER_ARTICLE_MONITOR_TIMEOUT = 3600
- TITLE_REWRITE_TIMEOUT = 1800
- RECYCLE_DAILY_ARTICLE_TIMEOUT = 3600
- UPDATE_ROOT_SOURCE_ID_TIMEOUT = 3600
- class TaskMapper(Const):
- def get_task_config(self, task_name) -> dict:
- match task_name:
- case "check_kimi_balance":
- expire_duration = self.CHECK_KIMI_BALANCE_TIMEOUT
- case "get_off_videos":
- expire_duration = self.GET_OFF_VIDEO_TIMEOUT
- case "check_publish_video_audit_status":
- expire_duration = self.CHECK_VIDEO_AUDIT_TIMEOUT
- case "outside_article_monitor":
- expire_duration = self.OUTSIDE_ARTICLE_MONITOR_TIMEOUT
- case "inner_article_monitor":
- expire_duration = self.INNER_ARTICLE_MONITOR_TIMEOUT
- case "title_rewrite":
- expire_duration = self.TITLE_REWRITE_TIMEOUT
- case "daily_publish_articles_recycle":
- expire_duration = self.RECYCLE_DAILY_ARTICLE_TIMEOUT
- case "update_root_source_id":
- expire_duration = self.UPDATE_ROOT_SOURCE_ID_TIMEOUT
- case _:
- expire_duration = self.DEFAULT_TIMEOUT
- return {"expire_duration": expire_duration}
|