sidekiq-limit_fetch 1.5 → 1.6

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: c530f12f2c18dba1c729e6271112081154a78b7f
4
- data.tar.gz: 0d9a6695cad3ec9965a2629ef8e8b83b171bcb8d
3
+ metadata.gz: a1422602115c90e1d7d70f170d00eb90bf2970d3
4
+ data.tar.gz: ebe990f7f327c3d7d6a6c8e0ed168db9333147a2
5
5
  SHA512:
6
- metadata.gz: 30851e2e580ae34f6e2a67d7fe6a44397e723a9811377d0afb4defc2a04ea821a5b498b16df70666558f04070923e1549f0c4e4a4633110a0f2d3b13b67c9dee
7
- data.tar.gz: f445df4cec59bf1773f9947eb3fd76b5e19eeacba7e73a6136bcd99828bd94dd2fe3c2ac48a60f2e3d6deb371add6251b55273e5a49883790e1e840581a2bb5e
6
+ metadata.gz: df8ccaaf84855dc0501ec30d7845ada4f2b806472c029175c3a874b129bf95fc69c449a4b5f8c038447b5352c33df6767ff10cf43d14c1696f8174b361595932
7
+ data.tar.gz: 8b3519ae107315273f22708035e17441bb040e01152e52b1fcb51c92bcf4696b46034a431613b360a6e738523635831ed747d210075b0bf6a8769368c7383f44
@@ -5,8 +5,8 @@ module Sidekiq::LimitFetch::Global
5
5
  HEARTBEAT_NAMESPACE = 'heartbeat:'
6
6
  PROCESSOR_NAMESPACE = 'processor:'
7
7
 
8
- HEARTBEAT_TTL = 90
9
- REFRESH_TIMEOUT = 60
8
+ HEARTBEAT_TTL = 18
9
+ REFRESH_TIMEOUT = 10
10
10
 
11
11
  def start!(ttl=HEARTBEAT_TTL, timeout=REFRESH_TIMEOUT)
12
12
  Thread.new do
@@ -22,9 +22,11 @@ module Sidekiq::LimitFetch::Global
22
22
 
23
23
  def update_heartbeat(ttl)
24
24
  Sidekiq.redis do |it|
25
- it.set processor_key, true
26
- it.set heartbeat_key, true
27
- it.expire heartbeat_key, ttl
25
+ it.pipelined do
26
+ it.set processor_key, true
27
+ it.set heartbeat_key, true
28
+ it.expire heartbeat_key, ttl
29
+ end
28
30
  end
29
31
  end
30
32
 
@@ -1,8 +1,9 @@
1
1
  require 'sidekiq'
2
- require 'sidekiq/fetch'
2
+ require 'forwardable'
3
3
 
4
4
  class Sidekiq::LimitFetch
5
- require_relative 'limit_fetch/unit_of_work'
5
+ autoload :UnitOfWork, 'sidekiq/limit_fetch/unit_of_work'
6
+
6
7
  require_relative 'limit_fetch/singleton'
7
8
  require_relative 'limit_fetch/queues'
8
9
  require_relative 'limit_fetch/local/semaphore'
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'sidekiq-limit_fetch'
3
- gem.version = '1.5'
3
+ gem.version = '1.6'
4
4
  gem.authors = 'brainopia'
5
5
  gem.email = 'brainopia@evilmartians.com'
6
6
  gem.summary = 'Sidekiq strategy to support queue limits'
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'sidekiq/limit_fetch'
2
+ require 'celluloid/autostart'
3
+ require 'sidekiq/fetch'
2
4
 
3
5
  RSpec.configure do |config|
4
6
  config.before :each do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-limit_fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - brainopia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-25 00:00:00.000000000 Z
11
+ date: 2013-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.0.0
111
+ rubygems_version: 2.0.3
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Sidekiq strategy to support queue limits