Skip to content

Commit

Permalink
Import ContextRepo defined in faststream_lifespan
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Aug 21, 2024
1 parent 5aa9751 commit 3386dec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 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
5 changes: 1 addition & 4 deletions fastagency/io/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from os import environ
from typing import Optional

from faststream import (
ContextRepo, # noqa
FastStream,
)
from faststream import FastStream
from faststream.nats import JStream, NatsBroker

from ..db.prisma import faststream_lifespan
Expand Down

0 comments on commit 3386dec

Please sign in to comment.