dawarich/app/jobs/cache/preheating_job.rb

16 lines
294 B
Ruby
Raw Normal View History

2024-12-06 10:52:36 -05:00
# frozen_string_literal: true
class Cache::PreheatingJob < ApplicationJob
queue_as :default
def perform
User.find_each do |user|
Rails.cache.write(
"dawarich/user_#{user.id}_years_tracked",
user.years_tracked,
expires_in: 1.day
)
2024-12-06 10:52:36 -05:00
end
end
end