Skip to content

Commit

Permalink
use AsyncGenerator for store instance
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Oct 9, 2024
1 parent 6fa777f commit 18db6ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion genotype_api/database/store.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Module for the store handler."""

from typing import AsyncGenerator

from sqlalchemy.exc import OperationalError
from sqlalchemy.ext.asyncio import AsyncSession
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed
Expand Down Expand Up @@ -39,7 +41,7 @@ async def create(cls) -> "Store":
return cls(session) # Return a Store instance with the session


async def get_store() -> Store:
async def get_store() -> AsyncGenerator[Store, None]:
"""Return a Store instance."""
store = await Store.create()
try:
Expand Down

0 comments on commit 18db6ea

Please sign in to comment.