FIX: Zeitwerk-related fixes for jobs. (#8187)

This commit is contained in:
Dan Ungureanu 2019-10-14 13:03:22 +03:00 committed by GitHub
parent 96b8710b39
commit 086b46051c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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!

View File

@ -7,7 +7,7 @@ module Jobs
every 3.minute
def execute(args)
Jobs.enqueue(:run_heartbeat, {})
::Jobs.enqueue(:run_heartbeat, {})
end
end
end