perf(douyu): 拆分任务槽并改造绑定扫码调度
This commit is contained in:
@@ -92,12 +92,24 @@ def list_jobs(
|
||||
# 巡检与重登是两个作业,但通过数据库联动:巡检把行标成 invalid,重登作业的
|
||||
# 候选条件正是这个字段。这里把「当前有多少条等着重登」一并返回,页面才能把
|
||||
# 这层上下游关系显示出来,而不是让人以为两个开关互不相干。
|
||||
from ..database import worker_engine
|
||||
from ..services.automation.jobs.ck_relogin import count_pending_relogin
|
||||
from ..services.binding_poll_scheduler import (
|
||||
scheduler_status as binding_poll_status,
|
||||
)
|
||||
from ..services.task_runtime import lane_stats
|
||||
|
||||
pending_relogin = count_pending_relogin(db)
|
||||
|
||||
return {
|
||||
"scheduler": scheduler_status(),
|
||||
"runtime": {
|
||||
"task_lanes": lane_stats(),
|
||||
"worker_db_pool": getattr(worker_engine.pool, "status", lambda: "")()
|
||||
if callable(getattr(worker_engine.pool, "status", None))
|
||||
else "",
|
||||
"binding_poll": binding_poll_status(),
|
||||
},
|
||||
"pending_relogin": pending_relogin,
|
||||
"jobs": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user