55
66@pytask .hookimpl (tryfirst = True )
77def pytask_execute_task_log_end (session : pytask .Session , report : pytask .ExecutionReport ) -> None :
8-
9- if not session .config ["dry_run" ]:
10- attrs = {"type" : "task" ,"name" : report .task .short_name , "path" : str (report .task .path ), "report" : str (report .outcome )}
11- address = ('localhost' , 6000 )
12- conn = Client (address , authkey = b'secret password' )
13- conn .send (json .dumps (attrs ))
14- conn .close ()
15-
8+ try :
9+ if not session .config ["dry_run" ]:
10+ attrs = {"type" : "task" ,"name" : report .task .short_name , "path" : str (report .task .path ), "report" : str (report .outcome )}
11+ address = ('localhost' , 6000 )
12+ conn = Client (address , authkey = b'secret password' )
13+ conn .send (json .dumps (attrs ))
14+ conn .close ()
15+ except Exception as e :
16+ pass
1617@pytask .hookimpl
1718def pytask_execute_log_end (session : pytask .Session , reports : list [pytask .ExecutionReport ]) -> None :
18- if not session .config ["dry_run" ]:
19- address = ('localhost' , 6000 )
20- conn = Client (address , authkey = b'secret password' )
21- conn .send ('close' )
22- conn .close ()
19+ try :
20+ if not session .config ["dry_run" ]:
21+ address = ('localhost' , 6000 )
22+ conn = Client (address , authkey = b'secret password' )
23+ conn .send ('close' )
24+ conn .close ()
25+ except Exception as e :
26+ pass
0 commit comments