feat: add TTLCache for get_cache_version and TEMPLATE_AUTO_RELOAD config with Makefile worker count variables

This commit is contained in:
2026-06-14 14:46:36 +00:00
parent c151325916
commit d75d5dc6a8
149 changed files with 9811 additions and 262 deletions
+4 -4
View File
@@ -10,7 +10,7 @@ from fastapi.responses import Response
from devplacepy.cache import TTLCache
from devplacepy.config import SECONDS_PER_DAY
from devplacepy.database import get_table, get_setting
from devplacepy.utils import verify_password, register_account
from devplacepy.utils import verify_password_async, register_account_async
from devplacepy.services.audit import record as audit
from devplacepy.services.devrant.params import merge_params
from devplacepy.services.devrant.tokens import issue_token, resolve_user, revoke_all
@@ -43,7 +43,7 @@ async def auth_token(request: Request):
if (
not user
or not user.get("is_active", True)
or not verify_password(password, user["password_hash"])
or not await verify_password_async(password, user["password_hash"])
):
audit.record(
request,
@@ -96,7 +96,7 @@ async def register(request: Request):
return dr_error("That username is already taken.", error_field="username")
if users.find_one(email=email):
return dr_error("That email is already registered.", error_field="email")
uid, role, is_first = register_account(username, email, password)
uid, role, is_first = await register_account_async(username, email, password)
logger.info("devrant registration for %s", username)
audit.record(
request,
@@ -155,7 +155,7 @@ async def edit_profile(request: Request):
get_table("users").update(updates, ["uid"])
audit.record(
request,
"user.profile.edit",
"profile.update",
user=user,
target_type="user",
target_uid=user["uid"],