upperkut 0.4.6 → 0.5.0

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: f1f1fcdb3d30ba7bce0fe4fd31efd81bf411a981644092441a734ca352c72497
4
- data.tar.gz: b75857ac9702474522d3134c49748abaede6a94fc79587a805c7800421c66f4f
3
+ metadata.gz: ba5fedf4d0ac284bdf31d593ea3f1528203665a2f1a666b6739f0d6427025960
4
+ data.tar.gz: 7cb2db3a24505ccb2cbecd2979eaca174e437c1588026ba13965922220ba90b4
5
5
  SHA512:
6
- metadata.gz: bd051b5d08c72ce5b314edd1ca20c8df9408e628eae155e1031e14570713688f257128a609b879d58629a19af9b6f9177123595b61ced4c6cdebfaefd71c3d52
7
- data.tar.gz: 3b7b6ef6e77284719a98a25ef050d5349487b26b563482bc3b8f3d388e5fa2bc306c0046cdadee93e8f828afb12330210ef53d6604ee945c893d055a484b281f
6
+ metadata.gz: '080691f125469829e4f4ab862d57da03d20e446d72678d1a79922e8c21139e2ce5e878f9e8041e1856c2f3949cd35fe0989d55f85a7be9906dea66491bb2a28a'
7
+ data.tar.gz: a6535b2c556183042251c94f600d5301919d1caeebb25cf2046f58710c9fcba568325a60a25d762ebaf0130f7eca1bafda4ef3e048ab66054cf2e96d288b723f
@@ -1,5 +1,10 @@
1
1
  # Upperkut changes
2
2
 
3
+ 0.5.x
4
+ ----------
5
+ - Fix thread-unsafe code that was overwriting worker configurations when
6
+ multiples workers were configured in the same process.
7
+
3
8
  0.4.x
4
9
  -----------
5
10
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- upperkut (0.4.6)
4
+ upperkut (0.5.0)
5
5
  redis (>= 3.3.3, < 5)
6
6
 
7
7
  GEM
@@ -51,12 +51,11 @@ require 'redis'
51
51
  # 4) That's it :)
52
52
  module Upperkut
53
53
  class Configuration
54
- attr_accessor :batch_size, :redis, :strategy, :max_wait, :polling_interval
54
+ attr_accessor :batch_size, :strategy, :max_wait, :polling_interval
55
55
 
56
56
  def self.default
57
57
  new.tap do |config|
58
58
  config.batch_size = 1_000
59
- config.redis = Redis.new
60
59
  config.max_wait = Integer(ENV['UPPERKUT_MAX_WAIT'] || 20)
61
60
  config.polling_interval = Integer(ENV['UPPERKUT_POLLING_INTERVAL'] || 5)
62
61
  end
@@ -6,7 +6,7 @@ module Upperkut
6
6
 
7
7
  attr_accessor :worker, :redis
8
8
 
9
- def initialize(worker, redis)
9
+ def initialize(worker, redis = Redis.new)
10
10
  self.worker = worker
11
11
  self.redis = redis
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Upperkut
2
- VERSION = '0.4.6'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
@@ -29,11 +29,11 @@ module Upperkut
29
29
  end
30
30
 
31
31
  def setup
32
- @@setup ||=
32
+ @config ||=
33
33
  begin
34
- default = Upperkut::Configuration.default.clone
35
- default.strategy ||= Upperkut::Strategy.new(self, default.redis)
36
- default
34
+ config = Upperkut::Configuration.default.clone
35
+ config.strategy = Upperkut::Strategy.new(self)
36
+ config
37
37
  end
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upperkut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Sousa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2018-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis