Skip to content

Commit

Permalink
multitenant setup (#2845)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodanswer authored Oct 18, 2024
1 parent 61424de commit 6e54c97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/danswer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
router as token_rate_limit_settings_router,
)
from danswer.setup import setup_danswer
from danswer.setup import setup_multitenant_danswer
from danswer.utils.logger import setup_logger
from danswer.utils.telemetry import get_or_generate_uuid
from danswer.utils.telemetry import optional_telemetry
Expand Down Expand Up @@ -182,6 +183,8 @@ async def lifespan(app: FastAPI) -> AsyncGenerator:
# If we are multi-tenant, we need to only set up initial public tables
with Session(engine) as db_session:
setup_danswer(db_session)
else:
setup_multitenant_danswer()

optional_telemetry(record_type=RecordType.VERSION, data={"version": __version__})
yield
Expand Down Expand Up @@ -312,6 +315,7 @@ def get_application() -> FastAPI:
prefix="/auth/oauth",
tags=["auth"],
)

# Need basic auth router for `logout` endpoint
include_router_with_global_prefix_prepended(
application,
Expand Down

0 comments on commit 6e54c97

Please sign in to comment.