diff --git a/docker-compose.yaml b/docker-compose.yaml index f598c1bb..10872178 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,7 +13,6 @@ services: volumes: - '.:/app' depends_on: - - dramatiq-worker - otel-collector command: - opentelemetry-instrument @@ -34,7 +33,6 @@ services: context: . target: http_app depends_on: - - dramatiq-worker - otel-collector env_file: local.env environment: diff --git a/local.env b/local.env index c33c1ba3..1f196a80 100644 --- a/local.env +++ b/local.env @@ -1,3 +1,4 @@ +ENVIRONMENT: "local" AUTH__JWKS_URL: "http://oathkeeper:4456/.well-known/jwks.json" -DRAMATIQ__REDIS_URL: "redis://redis:6379/0" +#DRAMATIQ__REDIS_URL: "redis://redis:6379/0" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317" diff --git a/src/common/dramatiq.py b/src/common/dramatiq.py index 53cee427..cf9234d8 100644 --- a/src/common/dramatiq.py +++ b/src/common/dramatiq.py @@ -37,8 +37,11 @@ def init_dramatiq(config: AppConfig): else: broker = StubBroker() # broker.emit_after("process_boot") - if config.ENVIRONMENT != "test": - logging.critical("Running a non-test environment without Redis URL set") + if config.ENVIRONMENT not in ["test", "local"]: + logging.critical( + "Running a non-test/non-local environment without Redis URL set", + extra={"ENVIRONMENT": config.ENVIRONMENT}, + ) broker.add_middleware(AsyncIO()) set_broker(broker) set_encoder(ORJSONEncoder()) diff --git a/tests/common/test_dramatiq.py b/tests/common/test_dramatiq.py index 4b1dbb12..4fba5ad0 100644 --- a/tests/common/test_dramatiq.py +++ b/tests/common/test_dramatiq.py @@ -70,4 +70,6 @@ def test_init_dramatiq_without_redis_url(caplog): with caplog.at_level(logging.CRITICAL): init_dramatiq(config) - assert "Running a non-test environment without Redis URL set" in caplog.text + assert ( + "Running a non-test/non-local environment without Redis URL set" in caplog.text + )