mumukit-nuntius 6.4.0 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44d3e96d6bef3cff0f7e9b99e1b0e7f1de3a48557cecfa3304cc6aff524092a5
4
- data.tar.gz: 5c0ab77e59b71b5280122585ebbd52a2548fb20be86aeb14d7d40256e678cd16
3
+ metadata.gz: a40dfe495d53fbec80c2c4a517a263c09e3cd594a11c583783e75011c4ecc685
4
+ data.tar.gz: a1693e5b6ebdb69ae012a83ed628c5995cce4070a69358ce46d328681378963b
5
5
  SHA512:
6
- metadata.gz: 17cca3d8abfaed13a4a937b6a44c1c62fb1f2f2d9d0cbaa8c769b29220bfcf3269565eb5a369119138a48887d10111a43c8c0d41801a981c73258a7345db80b6
7
- data.tar.gz: a7b15595886e7c5c0aa073ce49a417aa19f7a5d93f1891137292eb383c5a43304e209a30ad93d87506ab7921364e53aa334eeb54e132856ece1da25b74668582
6
+ metadata.gz: af62f17348bb2f38caadaf8918c43bab452e51c250c50bb0cc68c4256704b1c19426ca7d76d9a5cdc2584f478ee06e8e8cbcd6fa33a27c7e38e6f093766871eb
7
+ data.tar.gz: a8241fb34fa7a9ad8fa7972ded7b9774985b7264cea8689362e9f0d6239c11f0fc813c0ee9d055324aaad51cb534938d2b9a3c54fcd90bc70b44997a6f2c169a
@@ -5,12 +5,24 @@ module Mumukit::Nuntius::EventConsumer
5
5
  end
6
6
 
7
7
  def event(key, &block)
8
- @handlers[key] = block
8
+ @handlers[key] = with_database_reconnection &block
9
9
  end
10
10
 
11
11
  def build
12
12
  @handlers.with_indifferent_access
13
13
  end
14
+
15
+ private
16
+
17
+ def with_database_reconnection(&block)
18
+ return block unless defined? ActiveRecord
19
+ proc do |*args|
20
+ ActiveRecord::Base.connection_pool.with_connection do
21
+ block.call *args
22
+ end
23
+ end
24
+ end
25
+
14
26
  end
15
27
 
16
28
  class << self
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Nuntius
3
- VERSION = '6.4.0'
3
+ VERSION = '6.4.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.0
4
+ version: 6.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pina
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-12-02 00:00:00.000000000 Z
12
+ date: 2019-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler