unique_job 0.3.1.pre → 0.3.2.pre

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: 10d542ca656951df33aad35ccc2bc6a7084e817440b5350589f29d318200be78
4
- data.tar.gz: 1c029a320d84f7dc509a0315c1420e07fac331119ea643b58b391516c0f14804
3
+ metadata.gz: ae29717a10f707ecb27c4ee636e28fc13c7b113ac48cf1837f353c5c2cceee39
4
+ data.tar.gz: 8a0da599c02f6935a80717afa2e9dcf387722fa768b5b5593323b4041e483402
5
5
  SHA512:
6
- metadata.gz: 99507fb879e9708a1488081d7cc5b6115c77f2b38915a3a23e162b2b862ea090d5ffd368ac5fb777629523218529acf5635bc9fa47156b9c5de6e1d4e746393f
7
- data.tar.gz: 34d3309e4c134e5e8b03bf931473b84722d9393fc42d581acde96bdf7e268b410a38073ba25b2b8d797e8394df6ca344bee3ed2eb5ed93905cea84a1f9721b4a
6
+ metadata.gz: 9e173de697ab852500f66d3fe0dc938ae1d0883ab8cf7b0f0d918043af38490936e3d7917da2ce38deac90f4f68131758eb5d6e001691014465536b2acaacab9
7
+ data.tar.gz: f17a814a35307b00a4ae7b3347bb7c33690e6db4baa678964fa94db7022505fd6cb5f12d25d7f7c8b8ca3a8ff3f4a3278e2eff400a0ec84e6e1781321dc03be9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unique_job (0.3.1.pre)
4
+ unique_job (0.3.2.pre)
5
5
  redis
6
6
  sidekiq (> 6.0, < 7.0)
7
7
 
@@ -4,6 +4,10 @@ module UniqueJob
4
4
  class ClientMiddleware
5
5
  include Util
6
6
 
7
+ def initialize(redis_options)
8
+ @redis_options = redis_options
9
+ end
10
+
7
11
  def call(worker_str, job, queue, redis_pool, &block)
8
12
  if job.has_key?('at')
9
13
  # perform_in or perform_at
@@ -40,8 +40,10 @@ module UniqueJob
40
40
  end
41
41
 
42
42
  class << self
43
+ attr_accessor :redis_options
44
+
43
45
  def redis
44
- @redis ||= Redis.client(ENV['REDIS_HOST'])
46
+ @redis ||= Redis.new(redis_options)
45
47
  end
46
48
  end
47
49
 
@@ -4,6 +4,10 @@ module UniqueJob
4
4
  class ServerMiddleware
5
5
  include Util
6
6
 
7
+ def initialize(redis_options)
8
+ @redis_options = redis_options
9
+ end
10
+
7
11
  def call(worker, msg, queue, &block)
8
12
  perform_if_unique(worker, msg['args'], &block)
9
13
  end
@@ -38,6 +38,7 @@ module UniqueJob
38
38
 
39
39
  def job_history(worker)
40
40
  ttl = worker.respond_to?(:unique_in) ? worker.unique_in : 3600
41
+ JobHistory.redis_options = @redis_options
41
42
  JobHistory.new(worker.class, self.class, ttl)
42
43
  end
43
44
 
@@ -1,3 +1,3 @@
1
1
  module UniqueJob
2
- VERSION = "0.3.1.pre"
2
+ VERSION = "0.3.2.pre"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unique_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.pre
4
+ version: 0.3.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - ts-3156