dawarich/app/jobs/cache/preheating_job.rb
2025-07-27 01:08:29 +02:00

15 lines
292 B
Ruby

# frozen_string_literal: true
class Cache::PreheatingJob < ApplicationJob
queue_as :cache
def perform
User.find_each do |user|
Rails.cache.write(
"dawarich/user_#{user.id}_years_tracked",
user.years_tracked,
expires_in: 1.day
)
end
end
end