Skip to content

Commit

Permalink
defer event bus initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
keotl committed May 28, 2023
1 parent 5a5eb69 commit f993c86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jivago/config/production_jivago_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def configure_service_locator(self):
self.serviceLocator.bind(PartialContentHandler, PartialContentHandler)
self.serviceLocator.bind(HttpStatusCodeResolver, HttpStatusCodeResolver)
self.serviceLocator.bind(ObjectMapper, ObjectMapper)
self.serviceLocator.bind(EventBus, self.create_event_bus())
eventBusScope = SingletonScopeCache("_JivagoDependenciesSingleton", [EventBus])
self.serviceLocator.register_scope(eventBusScope)
self.serviceLocator.bind(EventBus, self.create_event_bus)
self.serviceLocator.bind(SynchronousEventBus, self.serviceLocator.get(EventBus))
self.serviceLocator.bind(AsyncEventBus, AsyncEventBus(self.serviceLocator.get(EventBus)))
self.serviceLocator.bind(RequestScopeCache, request_scope_cache)
Expand Down

0 comments on commit f993c86

Please sign in to comment.