From d09f743100d746971bba7ea076baea685f3f8de7 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 10 Aug 2022 07:31:43 -0400 Subject: [PATCH] Island: Register pypubsub Publisher in the DIContainer --- monkey/monkey_island/cc/services/initialize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/initialize.py b/monkey/monkey_island/cc/services/initialize.py index eeb488b14..3b55a7cb9 100644 --- a/monkey/monkey_island/cc/services/initialize.py +++ b/monkey/monkey_island/cc/services/initialize.py @@ -3,7 +3,7 @@ import logging from pathlib import Path from typing import Sequence -from pubsub import pub +from pubsub.core import Publisher from pymongo import MongoClient from common import DIContainer @@ -74,7 +74,8 @@ def initialize_services(data_dir: Path) -> DIContainer: ILockableEncryptor, RepositoryEncryptor(data_dir / REPOSITORY_KEY_FILE_NAME) ) container.register_instance(Version, container.resolve(Version)) - container.register_instance(IEventQueue, PyPubSubEventQueue(pub)) + container.register(Publisher, Publisher) + container.register_instance(IEventQueue, container.resolve(PyPubSubEventQueue)) _register_repositories(container, data_dir) _register_services(container)