From 64681bf19dac4f2636a2114b0e61b04f2a088953 Mon Sep 17 00:00:00 2001 From: Marcin Jachymiak Date: Tue, 3 Mar 2020 18:29:17 -0500 Subject: [PATCH] Fixup port env var --- setup-scripts/health-checker.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index d1dc57aa..64b6335b 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -3,11 +3,16 @@ from urllib.request import urlopen, Request import urllib, json, os, traceback, discord -portal_name = os.environ["PORTAL_NAME"] +# Get a port or use default +port = os.getenv("API_PORT") +if not port: + port = "9980" + +api_endpoint = "http://localhost:{}".format(port) +portal_name = os.getenv("PORTAL_NAME") # sc_precision is the number of hastings per siacoin sc_precision = 10 ** 24 -api_endpoint = "http://localhost:9980" # TODO get port from env/param # Discord bot initialization bot_token = os.environ["DISCORD_BOT_TOKEN"]