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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b03e4fcb8c750d690c00ab84b69838ba9395c06bcf57b710d6c015b6b1b8254d
|
4
|
+
data.tar.gz: a45b5017f30bf1d10307de9a55d1bfe0179c78d2573585e78db7eda68806c01d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
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.
|
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
|