lowkiq 1.2.3 → 1.2.5
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 +4 -4
- data/.gitignore +0 -1
- data/assets/app.js +322 -0
- data/lib/lowkiq/queue/fetch.rb +9 -9
- data/lib/lowkiq/queue/shard_metrics.rb +5 -5
- data/lib/lowkiq/version.rb +1 -1
- data/lib/lowkiq/web.rb +9 -4
- data/lowkiq.gemspec +1 -0
- metadata +4 -6
data/lib/lowkiq/queue/fetch.rb
CHANGED
|
@@ -6,12 +6,12 @@ module Lowkiq
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def fetch(redis, strategy, ids)
|
|
9
|
-
resp = redis.public_send strategy do
|
|
9
|
+
resp = redis.public_send strategy do |pipe|
|
|
10
10
|
ids.each do |id|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
pipe.zscore @keys.all_ids_scored_by_perform_in_zset, id
|
|
12
|
+
pipe.zscore @keys.all_ids_scored_by_retry_count_zset, id
|
|
13
|
+
pipe.zrange @keys.payloads_zset(id), 0, -1, with_scores: true
|
|
14
|
+
pipe.hget @keys.errors_hash, id
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -28,11 +28,11 @@ module Lowkiq
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def morgue_fetch(redis, strategy, ids)
|
|
31
|
-
resp = redis.public_send strategy do
|
|
31
|
+
resp = redis.public_send strategy do |pipe|
|
|
32
32
|
ids.each do |id|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
pipe.zscore @keys.morgue_all_ids_scored_by_updated_at_zset, id
|
|
34
|
+
pipe.zrange @keys.morgue_payloads_zset(id), 0, -1, with_scores: true
|
|
35
|
+
pipe.hget @keys.morgue_errors_hash, id
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -8,8 +8,8 @@ module Lowkiq
|
|
|
8
8
|
|
|
9
9
|
def call(queues)
|
|
10
10
|
result = @redis_pool.with do |redis|
|
|
11
|
-
redis.pipelined do
|
|
12
|
-
queues.each { |queue| pipeline
|
|
11
|
+
redis.pipelined do |pipe|
|
|
12
|
+
queues.each { |queue| pipeline pipe, queue }
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -20,15 +20,15 @@ module Lowkiq
|
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
def pipeline(
|
|
23
|
+
def pipeline(pipe, id)
|
|
24
24
|
name = id[:queue_name]
|
|
25
25
|
shard = id[:shard]
|
|
26
26
|
|
|
27
27
|
keys = Keys.new name
|
|
28
28
|
|
|
29
29
|
# lag [id, score]
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
pipe.zrange keys.ids_scored_by_perform_in_zset(shard),
|
|
31
|
+
0, 0, with_scores: true
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def pipeline_count
|
data/lib/lowkiq/version.rb
CHANGED
data/lib/lowkiq/web.rb
CHANGED
|
@@ -4,7 +4,10 @@ require "lowkiq/web/api"
|
|
|
4
4
|
|
|
5
5
|
module Lowkiq
|
|
6
6
|
module Web
|
|
7
|
-
HTML =
|
|
7
|
+
HTML = ->(env) {
|
|
8
|
+
path = env['PATH_INFO']
|
|
9
|
+
return [404, {}, ["not found"]] if path && path != '/'
|
|
10
|
+
|
|
8
11
|
root_path = env['SCRIPT_NAME']
|
|
9
12
|
[200, {}, [<<-HTML]]
|
|
10
13
|
<!DOCTYPE html>
|
|
@@ -22,7 +25,7 @@ module Lowkiq
|
|
|
22
25
|
</body>
|
|
23
26
|
</html>
|
|
24
27
|
HTML
|
|
25
|
-
|
|
28
|
+
}
|
|
26
29
|
|
|
27
30
|
ASSETS = File.expand_path("#{File.dirname(__FILE__)}/../../assets")
|
|
28
31
|
|
|
@@ -36,8 +39,10 @@ module Lowkiq
|
|
|
36
39
|
run Rack::File.new ASSETS, { 'Cache-Control' => 'public, max-age=86400' }
|
|
37
40
|
end
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
map "/" do
|
|
43
|
+
use Rack::ContentType, "text/html"
|
|
44
|
+
run HTML
|
|
45
|
+
end
|
|
41
46
|
end
|
|
42
47
|
|
|
43
48
|
def self.call(env)
|
data/lowkiq.gemspec
CHANGED
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
|
19
19
|
`git ls-files -z`
|
|
20
20
|
.split("\x0")
|
|
21
21
|
.reject { |f| f.match(%r{^(spec|frontend|examples|doc)/}) }
|
|
22
|
+
.push('assets/app.js')
|
|
22
23
|
end
|
|
23
24
|
spec.bindir = "exe"
|
|
24
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lowkiq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikhail Kuzmin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: redis
|
|
@@ -165,6 +164,7 @@ files:
|
|
|
165
164
|
- README.md
|
|
166
165
|
- README.ru.md
|
|
167
166
|
- Rakefile
|
|
167
|
+
- assets/app.js
|
|
168
168
|
- bin/console
|
|
169
169
|
- bin/setup
|
|
170
170
|
- deploy.md
|
|
@@ -199,7 +199,6 @@ licenses:
|
|
|
199
199
|
- LGPL
|
|
200
200
|
- EULA
|
|
201
201
|
metadata: {}
|
|
202
|
-
post_install_message:
|
|
203
202
|
rdoc_options: []
|
|
204
203
|
require_paths:
|
|
205
204
|
- lib
|
|
@@ -214,8 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
214
213
|
- !ruby/object:Gem::Version
|
|
215
214
|
version: '0'
|
|
216
215
|
requirements: []
|
|
217
|
-
rubygems_version:
|
|
218
|
-
signing_key:
|
|
216
|
+
rubygems_version: 4.0.23
|
|
219
217
|
specification_version: 4
|
|
220
218
|
summary: Lowkiq
|
|
221
219
|
test_files: []
|