mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
10 lines
323 B
Ruby
10 lines
323 B
Ruby
|
module Jobs
|
||
|
module Stats
|
||
|
def set_cache(klass, stats)
|
||
|
# Add some extra time to the expiry so that the next job run has plenty of time to
|
||
|
# finish before previous cached value expires.
|
||
|
$redis.setex klass.stats_cache_key, (klass.recalculate_stats_interval + 5).minutes, stats.to_json
|
||
|
end
|
||
|
end
|
||
|
end
|