Skip to content

Commit

Permalink
Import ContextRepo defined in faststream_lifespan (#49)
Browse files Browse the repository at this point in the history
* Import ContextRepo defined in faststream_lifespan

* Import ContextRepo defined in faststream_lifespan
  • Loading branch information
kumaranvpl committed Aug 21, 2024
1 parent 37d3738 commit 42be2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastagency/db/prisma.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from typing import TYPE_CHECKING, Any, AsyncGenerator, Dict, List, Optional, Union
from uuid import UUID

from faststream import ContextRepo
from prisma import Prisma # type: ignore[attr-defined]

from .base import BackendDBProtocol, DefaultDB, FrontendDBProtocol, KeyNotFoundError

if TYPE_CHECKING:
from fastapi import FastAPI
from faststream import ContextRepo


class PrismaBaseDB:
Expand Down Expand Up @@ -212,6 +212,6 @@ async def fastapi_lifespan(app: "FastAPI") -> AsyncGenerator[None, None]:


@asynccontextmanager
async def faststream_lifespan(context: "ContextRepo") -> AsyncGenerator[None, None]:
async def faststream_lifespan(context: ContextRepo) -> AsyncGenerator[None, None]:
async with _lifespan():
yield

0 comments on commit 42be2e2

Please sign in to comment.