FIX: Zeitwerk-related fixes for jobs. (#8187)
This commit is contained in:
parent
96b8710b39
commit
086b46051c
|
@ -282,7 +282,7 @@ module Jobs
|
|||
end
|
||||
|
||||
def self.enqueue(job_name, opts = {})
|
||||
klass = "Jobs::#{job_name.to_s.camelcase}".constantize
|
||||
klass = "::Jobs::#{job_name.to_s.camelcase}".constantize
|
||||
|
||||
# Unless we want to work on all sites
|
||||
unless opts.delete(:all_sites)
|
||||
|
|
|
@ -8,7 +8,7 @@ module Jobs
|
|||
|
||||
# Fill in the years of anniversary badges we missed
|
||||
(2..3).each do |year|
|
||||
Jobs::GrantAnniversaryBadges.new.execute(start_date: year.years.ago)
|
||||
::Jobs::GrantAnniversaryBadges.new.execute(start_date: year.years.ago)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Jobs
|
|||
when SocketError
|
||||
RETRY_TIMES[count]
|
||||
else
|
||||
Jobs::UserEmail.seconds_to_delay(count)
|
||||
::Jobs::UserEmail.seconds_to_delay(count)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ module Jobs
|
|||
when Net::SMTPServerBusy
|
||||
1.hour + (rand(30) * (count + 1))
|
||||
else
|
||||
Jobs::UserEmail.seconds_to_delay(count)
|
||||
::Jobs::UserEmail.seconds_to_delay(count)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ module Jobs
|
|||
every 1.day
|
||||
|
||||
def execute(args)
|
||||
Jobs::MigrateUrlSiteSettings::SETTINGS.each do |old_setting, new_setting|
|
||||
::Jobs::MigrateUrlSiteSettings::SETTINGS.each do |old_setting, new_setting|
|
||||
if SiteSetting.where("name = ? AND value IS NOT NULL", new_setting).exists?
|
||||
SiteSetting.set(old_setting, nil, warn: false)
|
||||
SiteSetting.find_by(name: old_setting).destroy!
|
||||
|
|
|
@ -7,7 +7,7 @@ module Jobs
|
|||
every 3.minute
|
||||
|
||||
def execute(args)
|
||||
Jobs.enqueue(:run_heartbeat, {})
|
||||
::Jobs.enqueue(:run_heartbeat, {})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue