workers fix

This commit is contained in:
JiriUhlir
2026-05-29 10:40:15 +02:00
parent 48a9b20379
commit 3804bb32c4
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -41,11 +41,11 @@ def run_migrations():
con.execute(
"""
CREATE TABLE IF NOT EXISTS workers (
worker_id TEXT PRIMARY KEY,
status TEXT,
last_seen_at TEXT,
id TEXT PRIMARY KEY,
status TEXT NOT NULL DEFAULT 'online',
started_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_seen_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
current_job_id INTEGER,
started_at TEXT,
metadata_json TEXT
)
"""
+6 -6
View File
@@ -51,14 +51,14 @@ def get_workers():
rows = con.execute(
"""
SELECT
worker_id,
id,
status,
started_at,
last_seen_at,
current_job_id,
started_at,
metadata_json
FROM workers
ORDER BY worker_id
ORDER BY id
"""
).fetchall()
@@ -73,14 +73,14 @@ def get_worker(worker_id: str):
row = con.execute(
"""
SELECT
worker_id,
id,
status,
started_at,
last_seen_at,
current_job_id,
started_at,
metadata_json
FROM workers
WHERE worker_id = ?
WHERE id = ?
""",
(worker_id,),
).fetchone()