FIX: Fix `Jobs::Onceoff.enqueue_all` undefined method for nilClass error (#28073)
In development, classes are lazy loaded so `Jobs::Onceoff.onceoff_job_klasses`
may not have been set. This is not a problem in production cause stuff
is eager loaded.
Follow-up to f4d06f195d
This commit is contained in:
parent
5b05cdfbd9
commit
5a37fa3760
|
@ -4,11 +4,14 @@ class Jobs::Onceoff < ::Jobs::Base
|
|||
sidekiq_options retry: false
|
||||
|
||||
class << self
|
||||
attr_reader :onceoff_job_klasses
|
||||
@@onceoff_job_klasses = Set.new
|
||||
|
||||
def inherited(klass)
|
||||
@onceoff_job_klasses ||= Set.new
|
||||
@onceoff_job_klasses << klass
|
||||
@@onceoff_job_klasses << klass
|
||||
end
|
||||
|
||||
def onceoff_job_klasses
|
||||
@@onceoff_job_klasses
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue