2021-07-30 11:43:38 +02:00
|
|
|
import os
|
2021-07-30 11:46:06 +02:00
|
|
|
import sys
|
|
|
|
import logging
|
2021-07-30 11:43:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
PIKA_URL = os.environ['PIKA_URL']
|
|
|
|
PIKA_OUTPUT_EXCHANGE = os.environ['PIKA_OUTPUT_EXCHANGE']
|
|
|
|
PIKA_INPUT_EXCHANGE = os.environ['PIKA_INPUT_EXCHANGE']
|
|
|
|
|
|
|
|
MODEL_INFO_URL = os.environ.get("MODEL_INFO_URL", "http://model-service/model/cnn/$default")
|
|
|
|
STORAGE_SERVICE_URL = os.environ.get("STORAGE_SERVICE_URL", "http://storage-service/")
|
|
|
|
|
|
|
|
SENTRY_DSN = os.environ.get("SENTRY_DSN")
|
|
|
|
|
|
|
|
RELEASE_ID = os.environ.get('RELEASE_ID', 'test')
|
|
|
|
RELEASEMODE = os.environ.get('RELEASEMODE', 'dev')
|
2021-07-30 11:46:06 +02:00
|
|
|
|
2021-08-04 14:49:40 +02:00
|
|
|
MODEL_CACHE_LIFETIME_SEC = int(os.environ.get("MODEL_CACHE_LIFETIME_SEC", 15))
|
|
|
|
|
2021-07-30 11:46:06 +02:00
|
|
|
LOG_LEVEL = logging.DEBUG if (
|
|
|
|
'--debug' in sys.argv
|
|
|
|
) or (
|
|
|
|
os.environ.get('DEBUG', '0').lower() in ['yes', 'true', '1']
|
|
|
|
) else logging.INFO
|