resque-heroku-signals 1.27.4 → 1.27.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5c3bda2200bc909e3b085034fbbf5f7b4b39828
4
- data.tar.gz: 75fe2983a09fe4511e99b8415d1097cfee7f9382
3
+ metadata.gz: d5132b492fff85cf94f3eb40020be2db975ec429
4
+ data.tar.gz: ca1220cdbd9711c5330d34e41fa50ad54f69609f
5
5
  SHA512:
6
- metadata.gz: ff03eb6273bce727ab50a6939d69687630d9db065bc65d1e2a1d3fe3d6f26d14400cc2c829460f6b54816b6c9d59c05858b469167ea041ba0c40e611c431ef19
7
- data.tar.gz: 36625fbff4fafba8e770abc05de271465664716945e8254c3aee119654839ac6c32e571767eba133c0300983ac8b7d73abef423267e6c72c14d8b0d02bc6be06
6
+ metadata.gz: a62bda832166979be5ec4ef9a7e62b6581b0f1992eae9b2444ec35f723738690dcf2d2c3f40fa49da45f396304fa1ed9271d946f3de82c73e0a2b2af3b69d1ba
7
+ data.tar.gz: da0e78106868f5794a423092a7979d2cf58a167ec0fa0b50b50be4a2d995c4ca6a5faf7f5c4603320fdfc21e5cf14d562bfbb88b55eea8e51f33a8fc8b13915f
data/.gitignore CHANGED
@@ -8,6 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /vendor/
11
+ *.gem
11
12
 
12
13
  # rspec failure tracking
13
14
  .rspec_status
data/README.md CHANGED
@@ -15,18 +15,25 @@ Add this line to your application's Gemfile:
15
15
  gem 'resque-heroku-signals'
16
16
  ```
17
17
 
18
+ Since this gem monkeypatches the Heroku worker the `gemspec` is locked to a `x.x.x` version of Resque. Issue a PR if this is not compatible with the version of resque you are using.
19
+
18
20
  ## Example Procfile
19
21
 
20
22
  ```
21
23
  worker: env QUEUE=* TERM_CHILD=1 INTERVAL=0.1 RESQUE_PRE_SHUTDOWN_TIMEOUT=20 RESQUE_TERM_TIMEOUT=8 bundle exec rake resque:work
22
-
23
24
  ```
24
25
 
25
- * Total time should be less than 0
26
26
  * `RESQUE_PRE_SHUTDOWN_TIMEOUT` time a job has to finish up before the `TermException` exception is raised
27
27
  * `RESQUE_TERM_TIMEOUT` time the job has to cleanup & save state
28
+ * Total shutdown time should be less than 30s. This is the time [Heroku gives you to cleanup before a `SIGKILL` is issued](https://devcenter.heroku.com/articles/dynos#shutdown)
28
29
  * `INTERVAL` seconds to wait between jobs
29
30
 
31
+ Also, make you don't buffer logs: import log messages could fail to push to stdout during the worker shutdown process:
32
+
33
+ ```ruby
34
+ $stdout.sync = true
35
+ ```
36
+
30
37
  ## License
31
38
 
32
39
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -6,16 +6,16 @@ Resque::Worker.class_eval do
6
6
  def unregister_signal_handlers
7
7
  trap('TERM') do
8
8
  trap('TERM') do
9
- puts "[resque-heroku] received second term signal, throwing term exception"
9
+ log_with_severity :info, "[resque-heroku] received second term signal, throwing term exception"
10
10
 
11
11
  trap('TERM') do
12
- puts "[resque-heroku] third or more time receiving TERM, ignoring"
12
+ log_with_severity :info, "[resque-heroku] third or more time receiving TERM, ignoring"
13
13
  end
14
14
 
15
15
  raise Resque::TermException.new("SIGTERM")
16
16
  end
17
17
 
18
- puts "[resque-heroku] received first term signal from heroku, ignoring"
18
+ log_with_severity :info, "[resque-heroku] received first term signal from heroku, ignoring"
19
19
 
20
20
  end
21
21
 
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module HerokuSignals
3
- VERSION = "1.27.4"
3
+ VERSION = "1.27.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-heroku-signals
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.4
4
+ version: 1.27.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bianco
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-06 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque