hirefire-resource 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hirefire-resource.gemspec +1 -1
- data/lib/hirefire/macro/resque.rb +10 -7
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a837ad85215ea4c9fb9db5d9df59e9d2efb9682
|
4
|
+
data.tar.gz: 019bb5a936269518290899332c41fc1b4c831e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f79e026eea2e841a67faeec56bceb7acf835dd08f31100447782de70c7715505cda00437fed0a72d33ffe6917dc944e0e9f11bcc73f422b2d3232b57bc0de22
|
7
|
+
data.tar.gz: fc1cb09f2e55ec48999f0a3a4ac01eec489696c44241d7f03babf6afbf93a20bd76d6f94daf8a33f2f23f92fb5866dd97ae835730c2c9ac96acd57f7549b9f59
|
data/hirefire-resource.gemspec
CHANGED
@@ -19,13 +19,17 @@ module HireFire
|
|
19
19
|
queues = queues.flatten.map(&:to_s)
|
20
20
|
queues = ::Resque.queues if queues.empty?
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
redis = ::Resque.redis
|
23
|
+
ids = Array(redis.smembers(:workers)).compact
|
24
|
+
raw_jobs = redis.pipelined { ids.map { |id| redis.get("worker:#{id}") } }
|
25
|
+
jobs = raw_jobs.map { |raw_job| ::Resque.decode(raw_job) || {} }
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
in_queues = redis.pipelined do
|
28
|
+
queues.map { |queue| redis.llen("queue:#{queue}") }
|
29
|
+
end.map(&:to_i).inject(&:+)
|
30
|
+
|
31
|
+
in_progress = jobs.inject(0) do |memo, job|
|
32
|
+
memo += 1 if queues.include?(job["queue"])
|
29
33
|
memo
|
30
34
|
end
|
31
35
|
|
@@ -34,4 +38,3 @@ module HireFire
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
37
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirefire-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Load-based scaling, schedule-based scaling, dyno crash recovery, for
|
14
14
|
web- and worker dynos.
|
@@ -61,4 +61,3 @@ signing_key:
|
|
61
61
|
specification_version: 4
|
62
62
|
summary: Autoscaling for your Heroku dynos
|
63
63
|
test_files: []
|
64
|
-
has_rdoc:
|