Skip to content

Commit 9649f2e

Browse files
author
Sergio García Prado
committed
ISSUE #98
* Be resilient to undefined saga config.
1 parent 9933c03 commit 9649f2e

File tree

1 file changed

+7
-1
lines changed
  • packages/core/minos-microservice-saga/minos/saga/executions

1 file changed

+7
-1
lines changed

packages/core/minos-microservice-saga/minos/saga/executions/storage.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
annotations,
33
)
44

5+
from contextlib import (
6+
suppress,
7+
)
58
from typing import (
69
Type,
710
Union,
@@ -12,6 +15,7 @@
1215

1316
from minos.common import (
1417
Config,
18+
MinosConfigException,
1519
MinosJsonBinaryProtocol,
1620
MinosStorage,
1721
MinosStorageLmdb,
@@ -46,7 +50,9 @@ def from_config(cls, config: Config, **kwargs) -> SagaExecutionStorage:
4650
:param kwargs: Additional named arguments.
4751
:return: A new ``SagaExecutionStorage`` instance.
4852
"""
49-
return cls(**(config.get_database_by_name("saga") | kwargs))
53+
with suppress(MinosConfigException):
54+
kwargs |= config.get_database_by_name("saga")
55+
return cls(**kwargs)
5056

5157
def store(self, execution: SagaExecution) -> None:
5258
"""Store an execution.

0 commit comments

Comments
 (0)