correct logic, so revalidation is reset

correct test so it can run at any point
This commit is contained in:
Sam
2017-03-13 10:47:43 -04:00
parent a690121805
commit 64680286f4
2 changed files with 15 additions and 2 deletions

View File

@ -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)