@@ -1205,6 +1205,7 @@ def heartbeat(worker_info, password, remote, current_state):
12051205 # Error message has already been printed.
12061206 current_state ["task_id" ] = None
12071207 current_state ["run" ] = None
1208+ current_state ["last_error" ] = req ["error" ]
12081209 else :
12091210 print ("Heartbeat stopped." )
12101211
@@ -1309,6 +1310,7 @@ def fetch_and_handle_task(
13091310 run , task_id = req ["run" ], req ["task_id" ]
13101311 current_state ["run" ] = run
13111312 current_state ["task_id" ] = task_id
1313+ current_state ["last_error" ] = None
13121314
13131315 print (f"Working on task { task_id } from { remote } /tests/view/{ run ['_id' ]} ." )
13141316 if "sprt" in run ["args" ]:
@@ -1368,6 +1370,7 @@ def fetch_and_handle_task(
13681370
13691371 current_state ["task_id" ] = None
13701372 current_state ["run" ] = None
1373+ current_state ["last_error" ] = None
13711374
13721375 payload = {
13731376 "password" : password ,
@@ -1462,6 +1465,7 @@ def worker():
14621465 current_state = {
14631466 "run" : None , # the current run
14641467 "task_id" : None , # the id of the current task
1468+ "last_error" : None , # set in the hearbeat loop
14651469 "alive" : True , # controls the main and heartbeat loop
14661470 "last_updated" : datetime .now (
14671471 timezone .utc
0 commit comments