File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ class WorkflowKillSwitch(Exception):
18
18
"""When processStatus != "success" and on-error=kill, raise this exception."""
19
19
20
20
def __init__ (self , job_id , rcode ):
21
+ """Record the job identifier and the error code."""
21
22
self .job_id = job_id
22
23
self .rcode = rcode
23
24
24
25
def __str__ (self ):
25
- return f'[job { self .job_id } ] activated kill switch with return code { self .rcode } '
26
+ """Represent this exception as a string."""
27
+ return f"[job { self .job_id } ] activated kill switch with return code { self .rcode } "
Original file line number Diff line number Diff line change @@ -547,7 +547,8 @@ def monitor_kill_switch() -> None:
547
547
nonlocal ks_tm
548
548
if kill_switch .is_set ():
549
549
_logger .error ("[job %s] terminating by kill switch" , self .name )
550
- if sproc .stdin : sproc .stdin .close ()
550
+ if sproc .stdin :
551
+ sproc .stdin .close ()
551
552
sproc .terminate ()
552
553
else :
553
554
ks_tm = Timer (interval = 1 , function = monitor_kill_switch )
Original file line number Diff line number Diff line change 7
7
import threading
8
8
from typing import Callable , Optional
9
9
10
- from .loghandler import _logger
11
10
from .errors import WorkflowKillSwitch
11
+ from .loghandler import _logger
12
12
13
13
14
14
class TaskQueue :
You can’t perform that action at this time.
0 commit comments