diff --git a/Gemfile b/Gemfile index c18b81beaf..8f4db4f7cd 100644 --- a/Gemfile +++ b/Gemfile @@ -59,7 +59,7 @@ gem 'bundler', '>= 1.5.0' gem 'coffee-rails', '~> 4.1.0' gem 'daemons', '~> 1.1.9' gem 'delayed_job', '~> 4.0.0' -gem 'delayed_job_active_record', '~> 4.0.0' +gem 'delayed_job_active_record', :git => 'https://github.com/cantino/delayed_job_active_record', :branch => 'configurable-reserve-sql-strategy' gem 'devise', '~> 3.4.0' gem 'dotenv-rails', '~> 2.0.1' gem 'em-http-request', '~> 1.1.2' diff --git a/Gemfile.lock b/Gemfile.lock index c7751b94a9..7b76362e2e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,6 +28,15 @@ GIT omniauth (~> 1.0) omniauth-oauth2 (~> 1.1) +GIT + remote: https://github.com/cantino/delayed_job_active_record + revision: 7ede4ea81561a66427f600decb87f6fcdb5b8aa4 + branch: configurable-reserve-sql-strategy + specs: + delayed_job_active_record (4.0.3) + activerecord (>= 3.0, < 5.0) + delayed_job (>= 3.0, < 4.1) + GEM remote: https://rubygems.org/ specs: @@ -119,9 +128,6 @@ GEM debug_inspector (0.0.2) delayed_job (4.0.6) activesupport (>= 3.0, < 5.0) - delayed_job_active_record (4.0.3) - activerecord (>= 3.0, < 5.0) - delayed_job (>= 3.0, < 4.1) delorean (2.1.0) chronic devise (3.4.1) @@ -525,7 +531,7 @@ DEPENDENCIES coveralls daemons (~> 1.1.9) delayed_job (~> 4.0.0) - delayed_job_active_record (~> 4.0.0) + delayed_job_active_record! delorean devise (~> 3.4.0) dotenv-rails (~> 2.0.1) diff --git a/config/initializers/delayed_job.rb b/config/initializers/delayed_job.rb index aa3de46e41..c1f04c489f 100644 --- a/config/initializers/delayed_job.rb +++ b/config/initializers/delayed_job.rb @@ -14,3 +14,7 @@ class Delayed::Job scope :awaiting_retry, ->{ where("failed_at IS NULL AND attempts > 0") } scope :failed, -> { where("failed_at IS NOT NULL") } end + +Delayed::Backend::ActiveRecord.configure do |config| + config.reserve_sql_strategy = :default_sql +end \ No newline at end of file