fix: 注销后关掉学习连接,目标为零不再显示成零比零

This commit is contained in:
2026-11-16 15:57:23 +08:00
parent 1cd7c7f818
commit 58b3dedb2a
8 changed files with 97 additions and 16 deletions
+7 -1
View File
@@ -8,6 +8,7 @@ from __future__ import annotations
import hmac
import threading
from contextlib import contextmanager
from admin.passwords import is_hashed, verify_password
from euniv.crypto import decrypt_secret
@@ -17,7 +18,12 @@ class AdminIdentity:
def __init__(self) -> None:
self._username = ""
self._password_cipher = ""
self._lock = threading.Lock()
self._lock = threading.RLock()
@contextmanager
def exclusive(self):
with self._lock:
yield
def replace(self, username: str, password_cipher: str) -> None:
with self._lock: