diff --git a/shared/infrastructure/factory.py b/shared/infrastructure/factory.py index c1c9298..a9d2864 100644 --- a/shared/infrastructure/factory.py +++ b/shared/infrastructure/factory.py @@ -366,7 +366,7 @@ def create_base_app( return await base_context() # --- event processor --- - _event_processor = EventProcessor(app_name=name) + _event_processor = None if no_db else EventProcessor(app_name=name) # --- startup --- @app.before_serving @@ -375,11 +375,13 @@ def create_base_app( register_shared_handlers() await init_config() print(pretty()) - await _event_processor.start() + if _event_processor: + await _event_processor.start() @app.after_serving async def _stop_event_processor(): - await _event_processor.stop() + if _event_processor: + await _event_processor.stop() from shared.infrastructure.auth_redis import close_auth_redis await close_auth_redis()