Skip to content

Commit

Permalink
Tweak import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
akuny committed Feb 6, 2024
1 parent 1c537bd commit 0c9ccd0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions nad_ch/config/development_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
)
from nad_ch.infrastructure.logger import BasicLogger
from nad_ch.infrastructure.storage import MinioStorage
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue


# Local development config
STORAGE_PATH = os.getenv("STORAGE_PATH")

postgres_user = os.getenv("POSTGRES_USER")
postgres_password = os.getenv("POSTGRES_PASSWORD")
postgres_host = os.getenv("POSTGRES_HOST")
Expand All @@ -24,7 +21,8 @@
f"postgresql+psycopg2://{postgres_user}:{postgres_password}"
f"@{postgres_host}:{postgres_port}/{postgres_db}"
)

QUEUE_BROKER_URL = os.getenv("QUEUE_BROKER_URL")
QUEUE_BACKEND_URL = os.getenv("QUEUE_BACKEND_URL")
S3_BUCKET_NAME = os.getenv("S3_BUCKET_NAME")
S3_ENDPOINT = os.getenv("S3_ENDPOINT")
S3_ACCESS_KEY = os.getenv("S3_ACCESS_KEY")
Expand Down Expand Up @@ -59,6 +57,8 @@ def create_storage(self):
)

def create_task_queue(self):
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue

return CeleryTaskQueue(celery_app)


Expand Down
4 changes: 2 additions & 2 deletions nad_ch/config/development_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
)
from nad_ch.infrastructure.logger import BasicLogger
from nad_ch.infrastructure.storage import S3Storage
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue


def get_credentials(service_name, default={}):
service = vcap_services.get(service_name, [default])
return service[0].get("credentials", default) if service else default


# Remote development config
vcap_services = json.loads(os.getenv("VCAP_SERVICES", "{}"))


Expand Down Expand Up @@ -66,6 +64,8 @@ def create_storage(self):
)

def create_task_queue(self):
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue

return CeleryTaskQueue(celery_app)


Expand Down
5 changes: 4 additions & 1 deletion nad_ch/config/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
FakeDataSubmissionRepository,
FakeStorage,
)
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue


DATABASE_URL = os.getenv("DATABASE_URL")
QUEUE_BROKER_URL = os.getenv("QUEUE_BROKER_URL")
QUEUE_BACKEND_URL = os.getenv("QUEUE_BACKEND_URL")


class TestApplicationContext(ApplicationContext):
Expand All @@ -35,6 +36,8 @@ def create_storage(self):
return FakeStorage()

def create_task_queue(self):
from nad_ch.infrastructure.task_queue import celery_app, CeleryTaskQueue

return CeleryTaskQueue(celery_app)


Expand Down
5 changes: 1 addition & 4 deletions nad_ch/infrastructure/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import geopandas as gpd
from nad_ch.application.interfaces import TaskQueue
from nad_ch.application.validation import get_feature_count


QUEUE_BROKER_URL = os.getenv("QUEUE_BROKER_URL")
QUEUE_BACKEND_URL = os.getenv("QUEUE_BACKEND_URL")
from nad_ch.config import QUEUE_BROKER_URL, QUEUE_BACKEND_URL


celery_app = Celery(
Expand Down

0 comments on commit 0c9ccd0

Please sign in to comment.