[PRISM] Block HTTP 502 sources; errors 105 to 19
This commit is contained in:
1 parent
fafe6b6e5d
commit
1eb2b4307f
4 files changed
+14
-9
No files matched your search
@@ -145,8 +145,11 @@ while True:
|
||||
cur.execute("update prism.tasks set status='done', finished_at=now() where id=%s", (task_id,))
|
||||
print("done", task_id, kind, flush=True)
|
||||
except Exception as e:
|
||||
cur.execute("update prism.tasks set status='error', error=%s, finished_at=now() where id=%s",
|
||||
(str(e)[:300], task_id))
|
||||
msg = str(e)[:300]
|
||||
bad = any(x in msg.lower() for x in ("no json", "empty text", "source missing", "no text", "no usable", "http error"))
|
||||
status = "blocked" if bad else "error"
|
||||
cur.execute("update prism.tasks set status=%s, error=%s, finished_at=now() where id=%s",
|
||||
(status, msg, task_id))
|
||||
cur.execute("""insert into prism.runs(model_id,kind,status,worker,model,error,started_at,finished_at)
|
||||
values (%s,'worker7b','error','229',%s,%s,now(),now())""",
|
||||
(mid, "qwen2.5:3b", str(e)[:300]))
|
||||
|
||||
Reference in new issue
Block a user