Fixed sending wrong format

This commit is contained in:
Pünkösd Marcell 2020-09-24 16:33:48 +02:00
parent aa078febc5
commit 8fa5114be1

View File

@ -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}")