forked from p15670423/monkey
Island: Match type based on __name__
This commit is contained in:
parent
ad5bba9e2f
commit
89954223e8
|
@ -35,7 +35,9 @@ class MongoEventRepository(IEventRepository):
|
|||
self, event_type: Type[AbstractAgentEvent]
|
||||
) -> Sequence[AbstractAgentEvent]:
|
||||
try:
|
||||
serialized_events = list(self._events_collection.find({EVENT_TYPE_FIELD: event_type}))
|
||||
serialized_events = list(
|
||||
self._events_collection.find({EVENT_TYPE_FIELD: event_type.__name__})
|
||||
)
|
||||
return list(map(self._deserialize, serialized_events))
|
||||
except Exception as err:
|
||||
raise RetrievalError(f"Error retrieving events for type {event_type}: {err}")
|
||||
|
|
Loading…
Reference in New Issue