mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-25 03:00:20 -04:00
Clean expired API keys every 24h
If someone logs in, then never logs back in while the key expires, then the key is stored in the dict and never deleted. So every 24 hours delete all keys that have been expired for more than 24 hours. Avoids a memory leak-like situation.
This commit is contained in:
@@ -55,6 +55,7 @@ class Constants:
|
||||
ADMIN_API_EXTENSION = "/admin"
|
||||
ADMIN_PREFIX = API_PREFIX + ADMIN_API_EXTENSION
|
||||
API_KEY_LENGTH = 32 # hexadecimal characters
|
||||
API_KEY_CLEANUP_INTERVAL = 86400 # seconds
|
||||
|
||||
DB_FOLDER = ("db",)
|
||||
DB_NAME = "MIND.db"
|
||||
|
||||
Reference in New Issue
Block a user