discourse/app/jobs/regular/update_disk_space.rb

13 lines
327 B
Ruby
Raw Normal View History

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