mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-05 07:10:29 +08:00
Fix: Cache the SECRET_KEY, if it is not set, RAGFlow will auto gen one, but if Redis evict keys due to lack of memory, it will cause re-generate secret key, that cause all requests 401 (#17707)
This commit is contained in:
@@ -175,7 +175,8 @@ def init_secret_key():
|
||||
def get_secret_key():
|
||||
global SECRET_KEY
|
||||
if SECRET_KEY is None:
|
||||
return _get_or_create_secret_key()
|
||||
# Why need cache it, if REDIS evict keys due to lack of memory, new secret key will be generated, cause all requests 401
|
||||
SECRET_KEY = _get_or_create_secret_key()
|
||||
return SECRET_KEY
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user