Skip to content

Commit 0bd3ccd

Browse files
committed
Convert jobs with no arguments to Sidekiq
This converts any of the jobs which take no arguments (and are likely queued on a schedule) to Sidekiq. Jobs without arguments are easier to convert to Sidekiq as there's no need to handle the argument serialisation and deserialisation, therefore we can switch these jobs directly. Jira-Issue: MAV-7288
1 parent b11669b commit 0bd3ccd

43 files changed

Lines changed: 535 additions & 541 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/controllers/api/testing/refresh_reporting_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
class API::Testing::RefreshReportingController < API::Testing::BaseController
44
def create
55
if params[:wait].present?
6-
ReportingAPI::RefreshJob.perform_now
6+
ReportingAPI::RefreshJob.new.perform
77
render status: :ok
88
else
9-
ReportingAPI::RefreshJob.perform_later
9+
ReportingAPI::RefreshJob.perform_async
1010
render status: :accepted
1111
end
1212
end

app/controllers/api/testing/vaccinations_search_in_nhs_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class API::Testing::VaccinationsSearchInNHSController < API::Testing::BaseContro
66

77
def create
88
if params[:wait].present?
9-
EnqueueVaccinationsSearchInNHSJob.perform_now
9+
EnqueueVaccinationsSearchInNHSJob.new.perform
1010
wait_for_search_jobs_to_complete
1111
render status: :ok
1212
else
13-
EnqueueVaccinationsSearchInNHSJob.perform_later
13+
EnqueueVaccinationsSearchInNHSJob.perform_async
1414
render status: :accepted
1515
end
1616
end

app/jobs/enqueue_automated_careplus_reports_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueueAutomatedCareplusReportsJob < ApplicationJobActiveJob
4-
queue_as :careplus
3+
class EnqueueAutomatedCareplusReportsJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :careplus
55

66
def perform
77
ids = Team.eligible_for_automated_careplus_reports.ids

app/jobs/enqueue_location_position_updater_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueueLocationPositionUpdaterJob < ApplicationJobActiveJob
4-
queue_as :third_party_data_imports
3+
class EnqueueLocationPositionUpdaterJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :third_party_data_imports
55

66
def perform
77
ids = Location.where(position: nil).has_address.ids

app/jobs/enqueue_patients_aged_out_of_schools_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueuePatientsAgedOutOfSchoolsJob < ApplicationJobActiveJob
4-
queue_as :patients
3+
class EnqueuePatientsAgedOutOfSchoolsJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :patients
55

66
def perform
77
academic_year = AcademicYear.pending

app/jobs/enqueue_process_unmatched_consent_forms_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# frozen_string_literal: true
22

3-
class EnqueueProcessUnmatchedConsentFormsJob < ApplicationJobActiveJob
3+
class EnqueueProcessUnmatchedConsentFormsJob < ApplicationJobSidekiq
44
include SingleConcurrencyConcern
55

6-
queue_as :consents
6+
sidekiq_options queue: :consents
77

88
def perform
99
ConsentForm.unmatched.find_each do |consent_form|

app/jobs/enqueue_school_consent_reminders_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueueSchoolConsentRemindersJob < ApplicationJobActiveJob
4-
queue_as :notifications
3+
class EnqueueSchoolConsentRemindersJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :notifications
55

66
def perform
77
sessions =

app/jobs/enqueue_school_consent_requests_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueueSchoolConsentRequestsJob < ApplicationJobActiveJob
4-
queue_as :notifications
3+
class EnqueueSchoolConsentRequestsJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :notifications
55

66
def perform
77
sessions =

app/jobs/enqueue_school_session_reminders_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
class EnqueueSchoolSessionRemindersJob < ApplicationJobActiveJob
4-
queue_as :notifications
3+
class EnqueueSchoolSessionRemindersJob < ApplicationJobSidekiq
4+
sidekiq_options queue: :notifications
55

66
def perform
77
sessions =

app/jobs/enqueue_update_patients_from_pds_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# frozen_string_literal: true
22

3-
class EnqueueUpdatePatientsFromPDSJob < ApplicationJobActiveJob
3+
class EnqueueUpdatePatientsFromPDSJob < ApplicationJobSidekiq
44
include SingleConcurrencyConcern
55

6-
queue_as :pds
6+
sidekiq_options queue: :pds
77

88
def perform
99
scope = Patient.not_deceased

0 commit comments

Comments
 (0)