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 +4 -4
- data/.gitignore +1 -0
- data/README.md +9 -2
- data/lib/resque/heroku-signals.rb +3 -3
- data/lib/resque/heroku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5132b492fff85cf94f3eb40020be2db975ec429
|
4
|
+
data.tar.gz: ca1220cdbd9711c5330d34e41fa50ad54f69609f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62bda832166979be5ec4ef9a7e62b6581b0f1992eae9b2444ec35f723738690dcf2d2c3f40fa49da45f396304fa1ed9271d946f3de82c73e0a2b2af3b69d1ba
|
7
|
+
data.tar.gz: da0e78106868f5794a423092a7979d2cf58a167ec0fa0b50b50be4a2d995c4ca6a5faf7f5c4603320fdfc21e5cf14d562bfbb88b55eea8e51f33a8fc8b13915f
|
data/.gitignore
CHANGED
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
|
-
|
9
|
+
log_with_severity :info, "[resque-heroku] received second term signal, throwing term exception"
|
10
10
|
|
11
11
|
trap('TERM') do
|
12
|
-
|
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
|
-
|
18
|
+
log_with_severity :info, "[resque-heroku] received first term signal from heroku, ignoring"
|
19
19
|
|
20
20
|
end
|
21
21
|
|
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-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|