diff --git a/kebab_worker/main.py b/kebab_worker/main.py index c812962..55421da 100644 --- a/kebab_worker/main.py +++ b/kebab_worker/main.py @@ -40,9 +40,21 @@ def worker_watchdog(outqueue, id): while True: try: worker(outqueue, id) + except KeyboardInterrupt: + break except: print(f"Worker {id} died! Restarting...") + print(f"Worker {id} exited!") + + +def denumpy_result(numpy_type) -> list: + denumyed = [] + for i in numpy_type: + denumyed = int(i) + + return denumyed + def main(): target_url = os.environ['TARGET_URL'] @@ -66,7 +78,7 @@ def main(): local_best = result_score try: - r = requests.post(target_url, json=result) + r = requests.post(target_url, json=denumpy_result(result)) r.raise_for_status() except (ConnectionError, requests.HTTPError) as e: print(f"Error while posting result: {e}")