This commit is contained in:
alyssa 2024-09-06 16:38:39 +09:00
parent 52e87805e0
commit 10cef41d25
2 changed files with 5 additions and 1 deletions

View file

@ -64,6 +64,7 @@ def report_status(name, start_time, exit=None):
response_code = e.getcode()
response_data = e.read()
print(f"{response_code} failed to update status {name}: {response_data}")
global global_fail
global_fail = True
def run_job(data):
@ -96,6 +97,7 @@ def main():
print("job failed!")
traceback.format_exc()
global global_fail
if global_fail:
ok = False

View file

@ -43,6 +43,7 @@ def spawn_job(name):
response_code = e.getcode()
response_data = e.read()
print(f"{response_code} failed to spawn job {name}: {response_data}")
global global_fail
global_fail = True
def create_jobs():
@ -103,7 +104,8 @@ def create_jobs():
if len(jobs) == 0:
print("no jobs to run (??)")
return 0 if not global_fail else 1
global global_fail
return 1 if global_fail else 0
if __name__ == "__main__":
print("hello from python!")