2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

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
No known key found for this signature in database
GPG key ID: FBD110179AAC1F20
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)