fix(scheduler): the dashboard no longer says a job has not run "this session" — runs are kept across restarts

This commit is contained in:
2026-10-17 23:22:13 +02:00
parent 8fd91b7b15
commit 911527a548
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta, timezone
import pytest import pytest
from sqlalchemy import select from sqlalchemy import select
from app import jobruns, logs, quota, scheduler, state from app import jobruns, logs, logsink, quota, scheduler, state
from app.models import AuditLog, JobRun, Notification, QuotaEvent from app.models import AuditLog, JobRun, Notification, QuotaEvent
from app.runstatus import RunStatus, RunTrigger from app.runstatus import RunStatus, RunTrigger
@@ -208,6 +208,8 @@ def test_a_runs_log_lines_carry_its_id(db):
(run,) = _runs(db, "autotag") (run,) = _runs(db, "autotag")
inside, after = (logs.record_fields(r).get("run_id") for r in handler.records) inside, after = (logs.record_fields(r).get("run_id") for r in handler.records)
assert (inside, after) == (run.id, None) assert (inside, after) == (run.id, None)
# …and it reaches the stored row, whose columns are the model's.
assert logsink.to_row(logs.record_fields(handler.records[0]))["run_id"] == run.id
def test_retention_reaps_finished_runs_only(db): def test_retention_reaps_finished_runs_only(db):
+2 -2
View File
@@ -18,7 +18,7 @@
"everyMin_other": "every {{count}} min", "everyMin_other": "every {{count}} min",
"runningNow": "Running now…", "runningNow": "Running now…",
"lastRun": "Last run {{time}}", "lastRun": "Last run {{time}}",
"neverRun": "Hasn't run yet this session", "neverRun": "No run recorded yet",
"active": "active", "active": "active",
"nextRun": "next", "nextRun": "next",
"quotaUsed": "{{used}} / {{budget}} units used today", "quotaUsed": "{{used}} / {{budget}} units used today",
@@ -57,7 +57,7 @@
"dot": { "dot": {
"running": "running now", "running": "running now",
"ok": "last run OK", "ok": "last run OK",
"idle": "idle (not run yet this session)", "idle": "idle (no run recorded yet)",
"error": "last run failed", "error": "last run failed",
"skipped": "skipped (sync paused)" "skipped": "skipped (sync paused)"
}, },
+2 -2
View File
@@ -18,7 +18,7 @@
"everyMin_other": "{{count}} percenként", "everyMin_other": "{{count}} percenként",
"runningNow": "Most fut…", "runningNow": "Most fut…",
"lastRun": "Utolsó futás {{time}}", "lastRun": "Utolsó futás {{time}}",
"neverRun": "Ebben a munkamenetben még nem futott", "neverRun": "Még nincs rögzített futás",
"active": "aktív", "active": "aktív",
"nextRun": "köv.", "nextRun": "köv.",
"quotaUsed": "{{used}} / {{budget}} egység ma felhasználva", "quotaUsed": "{{used}} / {{budget}} egység ma felhasználva",
@@ -57,7 +57,7 @@
"dot": { "dot": {
"running": "most fut", "running": "most fut",
"ok": "utolsó futás OK", "ok": "utolsó futás OK",
"idle": "tétlen (ebben a munkamenetben még nem futott)", "idle": "tétlen (még nincs rögzített futás)",
"error": "utolsó futás hibázott", "error": "utolsó futás hibázott",
"skipped": "kihagyva (szinkron szüneteltetve)" "skipped": "kihagyva (szinkron szüneteltetve)"
}, },