You've already forked RekomenciBackend
fix(): add flush to uow.add to ensure db sync
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Any, Protocol
|
||||
|
||||
class UnitOfWork(Protocol):
|
||||
@abstractmethod
|
||||
def add(self, *entities: Any) -> None:
|
||||
async def add(self, *entities: Any) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
|
||||
@@ -43,7 +43,9 @@ class UserSignUpInteractor:
|
||||
|
||||
response = UserSignUpResponse(access_token=crypted_access_token)
|
||||
|
||||
self.unit_of_work.add(user, access_token)
|
||||
for entity in (user, access_token): # preserve creation order
|
||||
await self.unit_of_work.add(entity)
|
||||
|
||||
await self.unit_of_work.commit()
|
||||
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user