If we can't detect nginx's IP and we're bound to fail the task we don't need to go on.

This commit is contained in:
Ivaylo Novakov 2022-02-11 13:47:00 +01:00
parent 9aa21088c5
commit 411996f784
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ async def block_skylinks_from_airtable():
"docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx"
)
if ipaddress == "":
print("Nginx's IP could not be detected. Exiting.")
return
print("Sending blocklist request to siad through nginx")
response = requests.post(
"http://" + ipaddress + ":8000/skynet/blocklist",