forked from kenzuya/unshackle
perf(api): move blocking file and hash work off the event loop
Run session-tracks serialization, request cache IO, session cache dir removal (now outside the store lock), history reads and gzip over 1 MiB on worker threads; cache the per-key PBKDF2 namespace and key_id.
This commit is contained in:
@@ -72,6 +72,7 @@ def mask_key(key: Optional[str]) -> str:
|
||||
return key[:4] + "…"
|
||||
|
||||
|
||||
@lru_cache(maxsize=1024)
|
||||
def key_id(key: Optional[str]) -> str:
|
||||
"""A stable id for an API key. A hash prefix, so two unnamed keys never collide the way
|
||||
``mask_key`` does, and the id carries no key material."""
|
||||
|
||||
Reference in New Issue
Block a user