mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
correct logic, so revalidation is reset
correct test so it can run at any point
This commit is contained in:
@ -23,6 +23,7 @@ class GlobalSetting
|
||||
def self.safe_secret_key_base
|
||||
|
||||
if @safe_secret_key_base && @token_in_redis && (@token_last_validated + REDIS_VALIDATE_SECONDS) < Time.now
|
||||
@token_last_validated = Time.now
|
||||
token = $redis.without_namespace.get(REDIS_SECRET_KEY)
|
||||
if token.nil?
|
||||
$redis.without_namespace.set(REDIS_SECRET_KEY, @safe_secret_key_base)
|
||||
|
Reference in New Issue
Block a user