mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: s/\$redis/Discourse\.redis (#8431)
This commit also adds a rubocop rule to prevent global variables.
This commit is contained in:
@@ -14,7 +14,7 @@ module DiscourseHub
|
||||
end
|
||||
|
||||
def self.stats_fetched_at=(time_with_zone)
|
||||
$redis.set STATS_FETCHED_AT_KEY, time_with_zone.to_i
|
||||
Discourse.redis.set STATS_FETCHED_AT_KEY, time_with_zone.to_i
|
||||
end
|
||||
|
||||
def self.get_payload
|
||||
@@ -102,7 +102,7 @@ module DiscourseHub
|
||||
end
|
||||
|
||||
def self.stats_fetched_at
|
||||
t = $redis.get(STATS_FETCHED_AT_KEY)
|
||||
t = Discourse.redis.get(STATS_FETCHED_AT_KEY)
|
||||
t ? Time.zone.at(t.to_i) : 1.year.ago
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user