Skip to content

Commit 9e6284b

Browse files
use settings
1 parent 5b1f97a commit 9e6284b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

services/storage/docker/healthcheck.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import sys
2626
from urllib.request import urlopen
2727

28-
from simcore_service_storage.main import ApplicationSettings
28+
from simcore_service_storage.core.settings import ApplicationSettings
2929

3030
SUCCESS, UNHEALTHY = 0, 1
3131

@@ -35,10 +35,9 @@
3535
# Queries host
3636
# pylint: disable=consider-using-with
3737

38+
app_settings = ApplicationSettings.create_from_envs()
3839

3940
def _is_celery_worker_healthy():
40-
app_settings = ApplicationSettings.create_from_envs()
41-
4241
assert app_settings.STORAGE_CELERY
4342
broker_url = app_settings.STORAGE_CELERY.CELERY_RABBIT_BROKER.dsn
4443

@@ -64,7 +63,7 @@ def _is_celery_worker_healthy():
6463

6564
ok = (
6665
ok
67-
or (bool(os.getenv("STORAGE_WORKER_MODE", "") and _is_celery_worker_healthy()))
66+
or (app_settings.STORAGE_WORKER_MODE and _is_celery_worker_healthy())
6867
or urlopen(
6968
"{host}{baseurl}".format(
7069
host=sys.argv[1], baseurl=os.environ.get("SIMCORE_NODE_BASEPATH", "")

0 commit comments

Comments
 (0)