dawarich/app/jobs/tracks/create_job.rb
2025-08-29 13:59:46 +02:00

13 lines
356 B
Ruby

# frozen_string_literal: true
class Tracks::CreateJob < ApplicationJob
queue_as :tracks
def perform(user_id, start_at: nil, end_at: nil, mode: :daily)
user = User.find(user_id)
Tracks::Generator.new(user, start_at:, end_at:, mode:).call
rescue StandardError => e
ExceptionReporter.call(e, 'Failed to create tracks for user')
end
end