Island: Initialize MongoDB connection before DI container so that repositories using mongo can be registered and subscribed

This commit is contained in:
Shreya Malviya 2022-09-20 17:07:28 +05:30
parent 638e4cd7ed
commit 5032588c23
1 changed files with 3 additions and 1 deletions

View File

@ -65,12 +65,14 @@ def run_monkey_island():
ip_addresses, deployment, version = _collect_system_info()
_send_analytics(deployment, version)
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
container = _initialize_di_container(ip_addresses, version, config_options.data_dir)
setup_island_event_handlers(container)
setup_agent_event_handlers(container)
_setup_agent_event_serializers(container)
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
_start_island_server(ip_addresses, island_args.setup_only, config_options, container)