Skip to content
Browse files

New signal handling of SIGTERM.

  • Loading branch information...
1 parent 7e2274a commit 06c2e11eaccd3b299b2b132a35edf94c463ba854 @wasabhi wasabhi committed
Showing with 4 additions and 1 deletion.
  1. +1 −1 Procfile
  2. +3 −0 lib/watermark.rb
View
2 Procfile
@@ -1,2 +1,2 @@
web: bundle exec rackup config.ru -p $PORT
-resque: bundle exec rake jobs:work
+resque: env TERM_CHILD=1 bundle exec rake jobs:work
View
3 lib/watermark.rb
@@ -1,4 +1,5 @@
require File.expand_path('../redis_keys', __FILE__)
+require 'resque/errors'
module RetriedJob
def on_failure_retry(e, *args)
@@ -33,6 +34,8 @@ def get_connection
def self.perform(key)
(new key).apply_watermark
+ rescue Resque::TermException
+ Resque.enqueue(self, key)
end
def apply_watermark

0 comments on commit 06c2e11

Please sign in to comment.
Something went wrong with that request. Please try again.