mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 12:43:45 +08:00
13 lines
327 B
Ruby
13 lines
327 B
Ruby
require 'disk_space'
|
|
|
|
module Jobs
|
|
class UpdateDiskSpace < Jobs::Base
|
|
sidekiq_options retry: false
|
|
|
|
def execute(args)
|
|
Discourse.cache.write(DiskSpace::DISK_SPACE_STATS_CACHE_KEY, DiskSpace.stats.to_json)
|
|
Discourse.cache.write(DiskSpace::DISK_SPACE_STATS_UPDATED_CACHE_KEY, Time.now.to_i)
|
|
end
|
|
end
|
|
end
|