background_worker 0.1.0 → 0.2.0

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: afd41f26182ca25b8082e658a1856a93ca76fda5
4
- data.tar.gz: e364c11af84478d7efe79eea9a2f1c5570b1f4ae
3
+ metadata.gz: 0e545bf8b33b749d412dcaabec85001174bc787a
4
+ data.tar.gz: 85b78869946fa35bc82a64d321ee2d49c3497ef6
5
5
  SHA512:
6
- metadata.gz: 237df4ae437ac88b1298868d09a6d2cf0b088a324f98356ddfd36af41d714c3b0248d41e825f62301e503c5dcd35414c1ed6edb0d29c1e10cc6b347985244f92
7
- data.tar.gz: 1068066f6120602cc08a90379328083721a19bf1c6d0be5d2df83f9fd366abf7e406e82edbcd1cec1059b902e8cee5706f97d4ea0cad7644695bdc8b4aa82274
6
+ metadata.gz: 230234c58f0cc42411c99e097832e509cd9085ac70f3170fc66e3f99f046793adfee09bfad01a1fb077ef0c0edac57d516cdbb7f213d6f80764bdd974eb706b3
7
+ data.tar.gz: e619104b7a7e7824e067be824aa90db4aeb0fd726520dd3898bb179c9c670fb83ddfce726cce6d345191ad97adb964c200ff18b697457cb45292ae894d8f0d59
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.2.0
9
+ ### Added
10
+ - [RU-79] Release connections after execution for Rails 4
11
+
8
12
  ## 0.1.0
9
13
  ### Added
10
14
  - [TT-1392] Changelog file
@@ -30,6 +30,12 @@ module BackgroundWorker
30
30
  end
31
31
  end
32
32
 
33
+ def self.release_connections!
34
+ if defined?(ActiveRecord) && ActiveRecord::VERSION::MAJOR >= 4
35
+ ActiveRecord::Base.clear_all_connections!
36
+ end
37
+ end
38
+
33
39
  def self.after_exception(e)
34
40
  config.after_exception(e)
35
41
  end
@@ -84,6 +84,8 @@ module BackgroundWorker
84
84
  worker = new(options)
85
85
  execution = WorkerExecution.new(worker, method_name, options)
86
86
  execution.call
87
+ ensure
88
+ BackgroundWorker.release_connections!
87
89
  end
88
90
  end
89
91
  end
@@ -1,3 +1,3 @@
1
1
  module BackgroundWorker
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: background_worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Noack
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-07-06 00:00:00.000000000 Z
13
+ date: 2017-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport