Module: Zeridion::Flare::RecurringJob::ClassMacros
- Defined in:
- lib/zeridion_flare/worker/recurring_job.rb
Instance Method Summary collapse
- #flare_cron ⇒ Object
- #flare_job_type ⇒ Object
- #flare_max_attempts ⇒ Object
- #flare_options(cron: nil, job_type: nil, queue: nil, timezone: nil, max_attempts: nil, timeout: nil) ⇒ Object
- #flare_queue ⇒ Object
- #flare_timeout ⇒ Object
- #flare_timezone ⇒ Object
Instance Method Details
#flare_cron ⇒ Object
48 49 50 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 48 def flare_cron @flare_cron end |
#flare_job_type ⇒ Object
52 53 54 55 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 52 def flare_job_type @flare_job_type || name || raise(ArgumentError, "anonymous recurring job class needs an explicit flare_options(job_type:)") end |
#flare_max_attempts ⇒ Object
65 66 67 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 65 def flare_max_attempts @flare_max_attempts || 3 end |
#flare_options(cron: nil, job_type: nil, queue: nil, timezone: nil, max_attempts: nil, timeout: nil) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 38 def (cron: nil, job_type: nil, queue: nil, timezone: nil, max_attempts: nil, timeout: nil) @flare_cron = cron unless cron.nil? @flare_job_type = job_type unless job_type.nil? @flare_queue = queue unless queue.nil? @flare_timezone = timezone unless timezone.nil? @flare_max_attempts = max_attempts unless max_attempts.nil? @flare_timeout = timeout unless timeout.nil? nil end |
#flare_queue ⇒ Object
57 58 59 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 57 def flare_queue @flare_queue || "default" end |
#flare_timeout ⇒ Object
69 70 71 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 69 def flare_timeout @flare_timeout || 1800 end |
#flare_timezone ⇒ Object
61 62 63 |
# File 'lib/zeridion_flare/worker/recurring_job.rb', line 61 def flare_timezone @flare_timezone || "UTC" end |