fix(work): show client idle timeout as red result-unknown card

This commit is contained in:
ex_tianzy
2026-11-12 16:47:23 +08:00
parent 43e7b97c0f
commit b497f8604e
5 changed files with 68 additions and 5 deletions
+4
View File
@@ -44,6 +44,7 @@ class TaskDelivery:
if auth.s.work_task_cards_enabled:
from .task_cards import TaskCards
self.cards=TaskCards(state,platform,broker.worker_id,files_enabled=auth.s.work_files_enabled)
broker.task_cards=self.cards
def current(self, body):
self.auth.require_binding(body.host_id,body.binding_owner,body.binding_generation)
@@ -96,6 +97,9 @@ class TaskDelivery:
self.db.execute('UPDATE work_execution_state_v3 SET execution_state=?,status_sequence=?,updated_at=? WHERE task_id=?',
(body.execution_state,body.status_sequence,time.time(),body.task_id))
pending=self.broker.pending.get(body.task_id)
if self.cards:
old=self.db.execute('SELECT status_sequence FROM work_execution_state_v3 WHERE task_id=?',(body.task_id,)).fetchone()
if old and body.status_sequence>=old['status_sequence']:self.cards.clear_connection_lost(body.task_id)
if pending and pending.host==body.host_id:
pending.progress.set()
return no_cache(JSONResponse(self.receipt(task)))