diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 7a81d6b20f..06eafd1c73 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -5,9 +5,4 @@ class ApplicationJob < ActiveJob::Base # :nodoc: # Most jobs are safe to ignore if the underlying records are no longer # available discard_on ActiveJob::DeserializationError - - def self.perform_later(*args) - return super unless AlaveteliConfiguration.background_jobs == 'inline' - perform_now(*args) - end end diff --git a/config/general.yml-example b/config/general.yml-example index 89af7a927c..12664cc604 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -1304,19 +1304,3 @@ SURVEY_URL: '' # # --- USER_SIGN_IN_ACTIVITY_RETENTION_DAYS: 0 - -# Background jobs are processed by Rails' ActiveJob using Sidekiq. There are -# various ways to run Sidekiq depending to server resources and technical -# knowledge in order to run and maintain a Redis server. -# -# Can either be set to: -# - 'inline' to process jobs within the web application process, this was the -# default option up until Alaveteli 0.42 and doesn't require Redis to be. -# installed. Due to issues with requests with web requests timing out this has -# been superseded by the other options. -# - 'server' to process job by a server running as a system daemon. -# -# BACKGROUND_JOBS – String (default: 'server') -# -# --- -BACKGROUND_JOBS: 'server' diff --git a/config/test.yml b/config/test.yml index 771668d0c8..03189027be 100644 --- a/config/test.yml +++ b/config/test.yml @@ -120,5 +120,3 @@ MAX_REQUESTS_PER_USER_PER_DAY: 2 SKIP_ADMIN_AUTH: true UTILITY_SEARCH_PATH: [] - -BACKGROUND_JOBS: 'server' diff --git a/lib/configuration.rb b/lib/configuration.rb index 926da9169a..d97a4cb449 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -21,7 +21,6 @@ module AlaveteliConfiguration ADMIN_USERNAME: '', AUTHORITY_MUST_RESPOND: true, AVAILABLE_LOCALES: 'en', - BACKGROUND_JOBS: 'server', BLACKHOLE_PREFIX: 'do-not-reply-to-this-address', BLOCK_RATE_LIMITED_IPS: false, BLOCK_RESTRICTED_COUNTRY_IPS: false, @@ -144,12 +143,6 @@ def self.get(key, default) value || MySociety::Config.get(key, default) end - def self.background_jobs - value = get('BACKGROUND_JOBS', DEFAULTS[:BACKGROUND_JOBS]) - return value if %w[inline server].include?(value) - raise 'Unknown value for BACKGROUND_JOBS. Please check config/general.yml' - end - def self.method_missing(name) key = name.to_s.upcase if DEFAULTS.key?(key.to_sym) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 49f4d52bd1..c0da65c8a2 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -68,8 +68,7 @@ namespace :config_files do { path: '/etc/systemd/system', name: 'sidekiq.service', - template: 'config/sidekiq.service.example', - condition: -> { AlaveteliConfiguration.background_jobs == 'server' } + template: 'config/sidekiq.service.example' } ] end