dawarich/app/jobs/tracks/create_job.rb

14 lines
356 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Tracks::CreateJob < ApplicationJob
2025-07-16 16:22:33 -04:00
queue_as :tracks
2025-07-16 16:22:33 -04:00
def perform(user_id, start_at: nil, end_at: nil, mode: :daily)
user = User.find(user_id)
2025-07-17 14:46:07 -04:00
2025-08-29 07:59:46 -04:00
Tracks::Generator.new(user, start_at:, end_at:, mode:).call
rescue StandardError => e
ExceptionReporter.call(e, 'Failed to create tracks for user')
end
end