From b9190233b199edeacd599899323070f485ecd9ac Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 29 Oct 2016 23:38:17 +0800 Subject: [PATCH] enable sucker punch for heroku (#878) --- Gemfile | 1 + Gemfile.lock | 5 ++++- config/application.rb | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5f22fdcb..9fd59b62 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ gem 'aws-sdk' gem 'best_in_place' gem 'delayed_job' gem 'delayed_job_active_record' +gem 'sucker_punch' gem 'devise' gem 'doorkeeper' gem 'dotenv-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 519795f8..92215068 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -244,6 +244,8 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) + sucker_punch (2.0.2) + concurrent-ruby (~> 1.0.0) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.5) @@ -299,6 +301,7 @@ DEPENDENCIES simplecov slack-notifier snorlax + sucker_punch tunemygc uglifier @@ -306,4 +309,4 @@ RUBY VERSION ruby 2.3.0p0 BUNDLED WITH - 1.13.3 + 1.13.6 diff --git a/config/application.rb b/config/application.rb index 9d8870a9..0b98bfe8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,6 +9,10 @@ Bundler.require(*Rails.groups) module Metamaps class Application < Rails::Application config.active_job.queue_adapter = :delayed_job + if ENV['ACTIVE_JOB_FRAMEWORK'] == 'sucker_punch' + config.active_job.queue_adapter = :sucker_punch + end + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.