2024-03-06 18:53:48 +03:00
|
|
|
import os
|
|
|
|
import requests
|
|
|
|
|
|
|
|
inference_address = os.environ["INFERENCE_API_ADDRESS"]
|
|
|
|
url = f"{inference_address}/update"
|
|
|
|
|
2024-05-29 13:41:09 +03:00
|
|
|
print("UPDATING INFERENCE WORKER DATA")
|
|
|
|
|
2024-03-06 18:53:48 +03:00
|
|
|
response = requests.get(url)
|
|
|
|
if response.status_code == 200:
|
|
|
|
# Request was successful
|
|
|
|
content = response.text
|
|
|
|
|
|
|
|
if content == "0":
|
|
|
|
print("Response content is '0'")
|
|
|
|
exit(0)
|
|
|
|
else:
|
|
|
|
exit(1)
|
|
|
|
else:
|
|
|
|
# Request failed
|
|
|
|
print(f"Request failed with status code: {response.status_code}")
|
|
|
|
exit(1)
|