refactor(scheduler): 排程迁移出web进程,迁入scheduler worker

This commit is contained in:
sophie committed 2026-07-30 19:52:41 +08:00
1 parent 970ee06537
commit 74745a9d10
21 files changed
+652 -223

No files matched your search

+2
View File
@@ -19,6 +19,8 @@ if TYPE_CHECKING:
def _resolve_poll_seconds(ctx: JobContext) -> float:
"""按队列配置读取轮询间隔。"""
queues = ctx.extras.get('queues') or ['kb']
if 'schedule' in queues and len(queues) == 1:
return float(ctx.config.get('SCHEDULE_WORKER_POLL_SECONDS', 30))
if 'shipping' in queues and 'kb' not in queues:
return float(ctx.config.get('SHIPPING_NOTICE_WORKER_POLL_SECONDS', 2))
return float(ctx.config.get('KB_WORKER_POLL_SECONDS', 2))