Island: Register mongo client as instance, not convention

This commit is contained in:
Mike Salvatore 2022-07-11 09:02:57 -04:00
parent b7786e2d0a
commit 14cbf07a21
1 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,10 @@ AGENT_BINARIES_PATH = Path(MONKEY_ISLAND_ABS_PATH) / "cc" / "binaries"
def initialize_services(data_dir: Path) -> DIContainer:
container = DIContainer()
_register_conventions(container, data_dir)
container.register_instance(AWSInstance, AWSInstance())
container.register_instance(MongoClient, MongoClient(MONGO_URL, serverSelectionTimeoutMS=100))
_register_repositories(container, data_dir)
_register_services(container)
@ -66,9 +69,6 @@ def _register_conventions(container: DIContainer, data_dir: Path):
"default_ransomware_agent_configuration",
DEFAULT_RANSOMWARE_AGENT_CONFIGURATION,
)
container.register_convention(
MongoClient, "mongo", MongoClient(MONGO_URL, serverSelectionTimeoutMS=100)
)
def _register_repositories(container: DIContainer, data_dir: Path):