perf(douyu): 优化慢查询并修复供应商充值收口

This commit is contained in:
yml
2026-11-21 11:20:58 +08:00
parent 3987464035
commit 9c90a452c5
14 changed files with 435 additions and 69 deletions
+10 -2
View File
@@ -409,7 +409,11 @@ class TestScheduler(_Base):
outcomes = run_due_jobs(self.session)
assert outcomes[0]["status"] == "failed"
run = self.session.query(AutomationRun).one()
run = (
self.session.query(AutomationRun)
.filter(AutomationRun.job_key == "boom")
.one()
)
assert run.status == "failed" and "接口挂了" in run.message
def test_next_run_follows_tick_and_counters_persist(self):
@@ -434,7 +438,11 @@ class TestScheduler(_Base):
assert _aware(job.next_run_at) - _aware(job.last_run_at) == timedelta(
seconds=JOB_INTERVAL_SECONDS
)
run = self.session.query(AutomationRun).one()
run = (
self.session.query(AutomationRun)
.filter(AutomationRun.job_key == "probe")
.one()
)
assert (run.scanned, run.valid, run.invalid) == (3, 2, 1)
def test_ensure_jobs_keeps_operator_settings(self):