Skip to content

Commit d18e39f

Browse files
author
Sergio García Prado
committed
ISSUE #442
* Improve timeout behaviour.
1 parent 4f585c5 commit d18e39f

File tree

1 file changed

+5
-2
lines changed
  • packages/core/minos-microservice-common/minos/common/database/clients

1 file changed

+5
-2
lines changed

packages/core/minos-microservice-common/minos/common/database/clients/abc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,14 @@ async def execute(self, operation: DatabaseOperation) -> None:
9999
await self._create_lock(operation.lock)
100100

101101
if isinstance(operation, ComposedDatabaseOperation):
102-
for op in operation.operations:
103-
await wait_for(self.execute(op), operation.timeout)
102+
await wait_for(self._execute_composed(operation), operation.timeout)
104103
else:
105104
await wait_for(self._execute(operation), operation.timeout)
106105

106+
async def _execute_composed(self, operation: ComposedDatabaseOperation) -> None:
107+
for op in operation.operations:
108+
await self.execute(op)
109+
107110
@abstractmethod
108111
async def _execute(self, operation: DatabaseOperation) -> None:
109112
raise NotImplementedError

0 commit comments

Comments
 (0)