mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 18:12:46 +08:00
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
|
sidekiq_options retry: false
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
attr_reader :onceoff_job_klasses
|
@@onceoff_job_klasses = Set.new
|
||||||
|
|
||||||
def inherited(klass)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user