Skip to content

Commit

Permalink
fix: replace lru_cache with async for getting odk creds
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 8, 2024
1 parent a7dac09 commit 33b86a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/app/projects/project_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

"""Project dependencies for use in Depends."""

from functools import lru_cache
from typing import Optional

from async_lru import alru_cache
from fastapi import Depends
from fastapi.exceptions import HTTPException
from loguru import logger as log
Expand Down Expand Up @@ -58,7 +58,7 @@ async def get_project_by_id(
return db_project


@lru_cache(maxsize=None)
@alru_cache(maxsize=32)
async def get_odk_credentials(db: Session, project_id: int):
"""Get ODK credentials of a project, or default organization credentials."""
sql = text(
Expand Down

0 comments on commit 33b86a7

Please sign in to comment.