ears 0.11.0 → 0.11.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
  SHA256:
3
- metadata.gz: c78842e806da5fc1ccc47697cd55a94e3f038fae3e0dc3688a6fa0b55bb1f4e5
4
- data.tar.gz: 3def90d115c5845bb4a0339465cf705447bf5398693913cc0e2080828ad86f93
3
+ metadata.gz: b5b2a2c4de31a20aa629cb7b7ae7a5c6e25208939e352e4bb49100a6f8edcfc1
4
+ data.tar.gz: d45e78a7922c5ec18d3fa67aed15b4125281235fe1df34131e3698163a234617
5
5
  SHA512:
6
- metadata.gz: ec53642022e0db616224c8beea49931d8be0ed5e89120e7e81729fd6c2dbe8713522db77e955c5b4231bb41f1f9de82bd613b64cc6d3760fbe1c0cbbfc15c550
7
- data.tar.gz: 62f101c0c19bcc5ef27ef220783bd73132b79a9d413d9f45b1642556de091738a6cd3e4817d6e9d5914aa39fac575dd4e9f585c8cedfae68bbc7808faedf5ebd
6
+ metadata.gz: 0ff0a50540f11484caa4b9c7f13b4bb5f6734f3c9505e7ea715e3429fbca41cb40392ba4788e0ca7390e550899ab79cb3fdecdb0a8d1d4b042493f56f3f833d8
7
+ data.tar.gz: d7618d2cb3b43ccf168136b7a40e6b4ca82b40569cbf64dcbaf485135f1977d76b4a78b40f811f63cb47f4781353d871889957cf26333097a85520c31bf0dca8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.1 (2023-09-08)
4
+
5
+ - Bugfix: trapped signals INT and TERM now calls correctly previous set signal handler
6
+
3
7
  ## 0.11.0 (2023-05-30)
4
8
 
5
9
  - **[Breaking]**: Provide the Bunny connection option `recovery_attempts` in Ears configuration. It
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ears (0.11.0)
4
+ ears (0.11.1)
5
5
  bunny (~> 2.22.0)
6
6
  multi_json
7
7
 
data/lib/ears/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ears
2
- VERSION = '0.11.0'
2
+ VERSION = '0.11.1'
3
3
  end
data/lib/ears.rb CHANGED
@@ -51,10 +51,9 @@ module Ears
51
51
  # Blocks the calling thread until +SIGTERM+ or +SIGINT+ is received.
52
52
  # Used to keep the process alive while processing messages.
53
53
  def run!
54
- running = true
55
- Signal.trap('INT') { running = false }
56
- Signal.trap('TERM') { running = false }
57
- sleep 1 while running && @error.nil?
54
+ @running = true
55
+ setup_traps
56
+ sleep 1 while @running && @error.nil?
58
57
  raise @error if @error
59
58
  end
60
59
 
@@ -82,6 +81,19 @@ module Ears
82
81
 
83
82
  private
84
83
 
84
+ def setup_traps
85
+ @previous_int_trap =
86
+ Signal.trap('INT') do
87
+ @running = false
88
+ @previous_int_trap&.call unless @previous_int_trap == 'DEFAULT'
89
+ end
90
+ @previous_term_trap =
91
+ Signal.trap('TERM') do
92
+ @running = false
93
+ @previous_term_trap&.call unless @previous_term_trap == 'DEFAULT'
94
+ end
95
+ end
96
+
85
97
  def connection_config
86
98
  {
87
99
  connection_name: configuration.connection_name,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InVision AG
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny