Module: RailsOnboarding::BackgroundJobs::ClassMethods
- Defined in:
- lib/rails_onboarding/background_jobs.rb
Instance Method Summary collapse
- #background_job_options ⇒ Object
-
#configure_background_jobs(options = {}) ⇒ Object
Configure background job options.
Instance Method Details
#background_job_options ⇒ Object
29 30 31 |
# File 'lib/rails_onboarding/background_jobs.rb', line 29 def @background_job_options || {} end |
#configure_background_jobs(options = {}) ⇒ Object
Configure background job options
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rails_onboarding/background_jobs.rb', line 15 def configure_background_jobs( = {}) @background_job_options = { adapter: .fetch(:adapter, :active_job), queue: .fetch(:queue, :default), enable_emails: .fetch(:enable_emails, true), enable_notifications: .fetch(:enable_notifications, true), retry_limit: .fetch(:retry_limit, 3), retry_delay: .fetch(:retry_delay, 5.minutes), enable_throttling: .fetch(:enable_throttling, true), max_jobs_per_user_per_hour: .fetch(:max_jobs_per_user_per_hour, MAX_JOBS_PER_USER_PER_HOUR), max_total_jobs_per_minute: .fetch(:max_total_jobs_per_minute, MAX_TOTAL_JOBS_PER_MINUTE) }.merge() end |