dawarich/app/jobs/cache/preheating_job.rb

16 lines
292 B
Ruby
Raw Normal View History

2024-12-06 10:52:36 -05:00
# frozen_string_literal: true
class Cache::PreheatingJob < ApplicationJob
2025-07-26 19:08:29 -04:00
queue_as :cache
2024-12-06 10:52:36 -05:00
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