Class: Sidekiq::Portal::JobManager::Builder Private
- Inherits:
-
Object
- Object
- Sidekiq::Portal::JobManager::Builder
- Defined in:
- lib/portal/job_manager/builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .build(config) ⇒ void private
Instance Method Summary collapse
- #build ⇒ Sidekiq::Portal::Manager private
- #initialize(config) ⇒ void constructor private
Constructor Details
#initialize(config) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 |
# File 'lib/portal/job_manager/builder.rb', line 22 def initialize(config) @scheduled_jobs_config = config.settings.scheduler_config @timezone = config.settings.default_timezone end |
Class Method Details
.build(config) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
12 13 14 |
# File 'lib/portal/job_manager/builder.rb', line 12 def build(config) new(config).build end |
Instance Method Details
#build ⇒ Sidekiq::Portal::Manager
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/portal/job_manager/builder.rb', line 31 def build current_time = ActiveSupport::TimeZone[timezone].at(Time.current) job_registry = Sidekiq::Portal::JobRegistry.new scheduled_jobs_config.each_pair do |job_config_series, | job_klass = resolve_job_klass(job_config_series, ) cron_pattern, every_pattern = resolve_time_configuration(job_klass, ) job_wrapper = build_job_wrapper(job_klass, cron_pattern, every_pattern, current_time) job_registry.register(job_wrapper) end Sidekiq::Portal::JobManager.new(job_registry) end |