DEV: Clean up some Redis leaks in test env.

This commit is contained in:
Guo Xiang Tan
2020-05-18 17:22:39 +08:00
parent 320b21ab5b
commit d01c336899
8 changed files with 50 additions and 9 deletions

View File

@ -15,8 +15,16 @@ class ApplicationRequest < ActiveRecord::Base
include CachedCounting
def self.disable
@enabled = false
end
def self.enable
@enabled = true
end
def self.increment!(type, opts = nil)
perform_increment!(redis_key(type), opts)
perform_increment!(redis_key(type), opts) if @enabled
end
def self.write_cache!(date = nil)