dawarich/app/jobs/visit_suggesting_job.rb

12 lines
313 B
Ruby
Raw Normal View History

2024-08-12 16:18:11 -04:00
# frozen_string_literal: true
2024-08-05 15:23:08 -04:00
class VisitSuggestingJob < ApplicationJob
queue_as :default
2024-08-25 13:46:50 -04:00
def perform(user_ids: [], start_at: 1.day.ago, end_at: Time.current)
2024-08-12 16:18:11 -04:00
users = user_ids.any? ? User.where(id: user_ids) : User.all
users.find_each { Visits::Suggest.new(_1, start_at:, end_at:).call }
2024-08-05 15:23:08 -04:00
end
end