Separated config

This commit is contained in:
2021-07-30 11:43:38 +02:00
parent bcbc69e00f
commit aa2cc0214c
4 changed files with 34 additions and 19 deletions

View File

@@ -6,13 +6,13 @@ import requests
import time
from urllib.parse import urljoin
from config import Config
from classifier_cache import ClassifierCache
class MagicDoer:
classifier_cache = ClassifierCache(
os.environ.get("MODEL_INFO_URL", "http://model-service/model/cnn/$default")
)
classifier_cache = ClassifierCache(Config.MODEL_INFO_URL)
@classmethod
def run_everything(cls, parameters: dict) -> dict:
@@ -22,8 +22,7 @@ class MagicDoer:
try:
# Download Sample
storage_service_url = os.environ.get("STORAGE_SERVICE_URL", "http://storage-service/")
object_path = urljoin(storage_service_url, f"object/{tag}")
object_path = urljoin(Config.STORAGE_SERVICE_URL, f"object/{tag}")
logging.info(f"Downloading sample: {tag} from {object_path}")
r = requests.get(object_path)