boardintel_frenzy_bunnies 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frenzy_bunnies/version.rb +1 -1
- data/lib/frenzy_bunnies/worker.rb +24 -23
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfbd7c57015e5b1b9a4cbd6c0e98a19f14aafd42
|
4
|
+
data.tar.gz: 6389c4b8d9e68bb9a7068bb5adad9661745c5282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef6a99f86d141881718f486eea41bd9f5825ea966211061193294f267e927f0c08a1621b2e0f8e4e9fd9a1b8b80ba1085cc80764c64b36754dbc137895eddbdc
|
7
|
+
data.tar.gz: ff754507a6f9045544591cc03abaad925c68b8e521dcc85b7465d149224cc47a751d61da21d820dc2bed9248f58da2c56326703a754a0b9527cceb5cf54c171c
|
@@ -42,33 +42,34 @@ module FrenzyBunnies::Worker
|
|
42
42
|
|
43
43
|
q = context.queue_factory.build_queue(@queue_name, @queue_opts)
|
44
44
|
|
45
|
-
say "#{@queue_opts[:threads]
|
46
|
-
|
47
|
-
q.subscribe(:ack => true, :blocking => false
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
45
|
+
say "#{@queue_opts[:threads]} with #{@queue_opts[:prefetch]} prefetch on <#{@queue_name}>."
|
46
|
+
|
47
|
+
q.subscribe(:ack => true, :blocking => false) do |headers, msg|
|
48
|
+
@thread_pool.submit do
|
49
|
+
worker = new
|
50
|
+
handler = @queue_opts[:handler].new(headers.channel, q, @logger, { queue_options: @queue_opts })
|
51
|
+
begin
|
52
|
+
Timeout::timeout(@queue_opts[:timeout_job_after]) do
|
53
|
+
if worker.work(msg)
|
54
|
+
handler.acknowledge(headers, msg)
|
55
|
+
incr! :passed
|
56
|
+
else
|
57
|
+
handler.reject(headers, msg)
|
58
|
+
incr! :failed
|
59
|
+
error "REJECTED", msg
|
60
|
+
end
|
59
61
|
end
|
62
|
+
rescue Timeout::Error
|
63
|
+
handler.timeout(headers, msg)
|
64
|
+
incr! :failed
|
65
|
+
error "TIMEOUT #{@queue_opts[:timeout_job_after]}s", msg
|
66
|
+
rescue
|
67
|
+
handler.reject(headers, msg)
|
68
|
+
incr! :failed
|
69
|
+
error "ERROR #{$!}", msg
|
60
70
|
end
|
61
|
-
rescue Timeout::Error
|
62
|
-
handler.timeout(headers, msg)
|
63
|
-
incr! :failed
|
64
|
-
error "TIMEOUT #{@queue_opts[:timeout_job_after]}s", msg
|
65
|
-
rescue
|
66
|
-
handler.reject(headers, msg)
|
67
|
-
incr! :failed
|
68
|
-
error "ERROR #{$!}", msg
|
69
71
|
end
|
70
72
|
end
|
71
|
-
|
72
73
|
say "workers up."
|
73
74
|
end
|
74
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boardintel_frenzy_bunnies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dotan Nahum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|