fix: 注销后关掉学习连接,目标为零不再显示成零比零
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user