sidekiq-ultimate 0.0.1.alpha.17 → 0.0.1.alpha.18

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: f6f524ab4f87ba7a8c687046e2ef2893b29a709d35765620df2c212bb5325cc2
4
- data.tar.gz: 7be36332d763fb27106eb4212a9454aa54b665df630ec27df90c777fc0c7638b
3
+ metadata.gz: b03e4fcb8c750d690c00ab84b69838ba9395c06bcf57b710d6c015b6b1b8254d
4
+ data.tar.gz: a45b5017f30bf1d10307de9a55d1bfe0179c78d2573585e78db7eda68806c01d
5
5
  SHA512:
6
- metadata.gz: ce2c291e7b34d21adb5c9d1c57fb48208eb385714a9650233519f507d878ecc6efbb6089eb284e149ce262ea5e1b04e5f586628d5143bb42d4617e3e0729f53c
7
- data.tar.gz: f4aca94bb0798554e6fcfda6617af4c9ec6f905ea31dcdceff1c8fb450523f9c423060630cba0d870b5ef03ad9b1ccf9fb19dda1c8587bfe9f1c35cbad8480c0
6
+ metadata.gz: 4daadb4fd2d32bab2119968ac1e290fbf75daeba8ad3e77c276ee8fc284e1df8fb22bd7b76d9cb80d0fd18258cd1e4cd412c8637405b0354b8c90dc414bd1d26
7
+ data.tar.gz: c894a3c906a12ee3552237324a17d0bd36d89c448b8105f784113064e70d8b577e1c98f9c5011a74b3860ae11621ea66baabe99bbdde23a337c872ecd6dd2ad0
@@ -34,7 +34,7 @@ module Sidekiq
34
34
 
35
35
  # Create a new ExpirableSet instance.
36
36
  def initialize
37
- @set = {}
37
+ @set = Hash.new(0.0)
38
38
  @mon = Monitor.new
39
39
  end
40
40
 
@@ -55,9 +55,7 @@ module Sidekiq
55
55
  expires_at = Concurrent.monotonic_time + ttl
56
56
 
57
57
  # do not allow decrease element's expiry
58
- break if @set.key?(element) && expires_at <= @set[element]
59
-
60
- @set[element] = expires_at
58
+ @set[element] = expires_at if @set[element] < expires_at
61
59
  end
62
60
 
63
61
  self
@@ -23,7 +23,6 @@ module Sidekiq
23
23
  def initialize(options)
24
24
  @exhausted = ExpirableSet.new
25
25
 
26
- @debug = ENV["DEBUG_SIDEKIQ_ULTIMATE"] ? {} : nil
27
26
  @strict = options[:strict] ? true : false
28
27
  @queues = options[:queues].map { |name| QueueName.new(name) }
29
28
 
@@ -37,7 +36,8 @@ module Sidekiq
37
36
  if work&.throttled?
38
37
  work.requeue_throttled
39
38
 
40
- @exhausted.add(work.queue, :ttl => THROTTLE_TIMEOUT)
39
+ queue = QueueName.new(work.queue_name)
40
+ @exhausted.add(queue, :ttl => THROTTLE_TIMEOUT)
41
41
 
42
42
  return nil
43
43
  end
@@ -59,8 +59,6 @@ module Sidekiq
59
59
  def retrieve
60
60
  Sidekiq.redis do |redis|
61
61
  queues.each do |queue|
62
- debug!(queue)
63
-
64
62
  job = redis.rpoplpush(queue.pending, queue.inproc)
65
63
  return UnitOfWork.new(queue, job) if job
66
64
 
@@ -86,18 +84,6 @@ module Sidekiq
86
84
  instance_variable_get(:@paused_queues).
87
85
  map { |q| QueueName[q] }
88
86
  end
89
-
90
- def debug!(queue)
91
- return unless @debug
92
-
93
- previous, @debug[queue] = @debug[queue], Concurrent.monotonic_time
94
-
95
- return unless previous
96
-
97
- Sidekiq.logger.debug do
98
- "Queue #{queue} last time polled: #{@debug[queue] - previous} s ago"
99
- end
100
- end
101
87
  end
102
88
  end
103
89
  end
@@ -3,6 +3,6 @@
3
3
  module Sidekiq
4
4
  module Ultimate
5
5
  # Gem version.
6
- VERSION = "0.0.1.alpha.17"
6
+ VERSION = "0.0.1.alpha.18"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-ultimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha.17
4
+ version: 0.0.1.alpha.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
@@ -114,7 +114,6 @@ files:
114
114
  - lib/sidekiq/ultimate.rb
115
115
  - lib/sidekiq/ultimate/expirable_set.rb
116
116
  - lib/sidekiq/ultimate/fetch.rb
117
- - lib/sidekiq/ultimate/fetch/debug.rb
118
117
  - lib/sidekiq/ultimate/queue_name.rb
119
118
  - lib/sidekiq/ultimate/resurrector.rb
120
119
  - lib/sidekiq/ultimate/resurrector/resurrect.lua
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "sidekiq/throttled"
4
-
5
- require "sidekiq/ultimate/debugging"
6
- require "sidekiq/ultimate/expirable_set"
7
- require "sidekiq/ultimate/queue_name"
8
- require "sidekiq/ultimate/resurrector"
9
- require "sidekiq/ultimate/unit_of_work"
10
-
11
- module Sidekiq
12
- module Ultimate
13
- # Throttled reliable fetcher implementing reliable queue pattern.
14
- class Fetch
15
- class Debug
16
- def initialize
17
- @queues_stats = {}
18
- end
19
- end
20
- end
21
- end
22
- end