hirefireapp 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f77f454e1a4cbf917e951745f223cb11b71dbc52
4
- data.tar.gz: a325cea5826ed2f9da7e3e049e960968de71d55a
3
+ metadata.gz: 09ece4ab764a8b91c0f9c27c7e4a204a47dd86de
4
+ data.tar.gz: 99e0c0b349e1569248c39ec944f3ef0a3373b923
5
5
  SHA512:
6
- metadata.gz: d4c918545f57406bacb79f2fa7bd8002332d2e55fbd467bbd105c28ed57083351abf3bf01cdfc29459d8e49560096903ef854239ab83da52dd399637f5294378
7
- data.tar.gz: 1b8771df7f8b519eb3473dc634c8c114d12bb088d10ac28bbaa1aa90133c143282f47377d17e2015b69910542c60aec8b74ffe7b42840bcfd8b56bb308e595e0
6
+ metadata.gz: 0bf29825cbd84054ab4a4b25fb26bc27b9eb3576de0a9af60b03ada2ec847d60a6b36a11dca4a51cb27b96dd326edddcb9199e28d91bc9c688c9b41e2d524e49
7
+ data.tar.gz: 49c80645f395a935b8fcedae2c90d17bdb0232fc0bce725e2cf487c4d438821bc9f18a7b2fb432266f4f8f0df4e31d964f6c970aaeed64f6196ccd07dc6b189c
@@ -4,7 +4,7 @@ Gem::Specification.new do |gem|
4
4
 
5
5
  # General configuration / information
6
6
  gem.name = 'hirefireapp'
7
- gem.version = '0.1.2'
7
+ gem.version = '0.2.0'
8
8
  gem.platform = Gem::Platform::RUBY
9
9
  gem.authors = 'Michael van Rooijen'
10
10
  gem.email = 'michael@hirefire.io'
@@ -9,7 +9,7 @@ module HireFireApp
9
9
  #
10
10
  def initialize(app)
11
11
  @app = app
12
- @token = ENV['HIREFIREAPP_TOKEN']
12
+ @token = ENV['HIREFIREAPP_TOKEN'] || "development"
13
13
  end
14
14
 
15
15
  ##
@@ -129,8 +129,19 @@ module HireFireApp
129
129
  # the number of jobs pending + the amount of workers currently working
130
130
  #
131
131
  def count_resque
132
- info = Resque.info
133
- info[:pending].to_i + info[:working].to_i
132
+ queues = ::Resque.queues
133
+
134
+ in_queues = queues.inject(0) do |memo, queue|
135
+ memo += ::Resque.size(queue)
136
+ memo
137
+ end
138
+
139
+ in_progress = ::Resque::Worker.all.inject(0) do |memo, worker|
140
+ memo += 1 if queues.include?(worker.job["queue"])
141
+ memo
142
+ end
143
+
144
+ in_queues + in_progress
134
145
  end
135
146
 
136
147
  ##
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hirefireapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
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: 2013-04-04 00:00:00.000000000 Z
11
+ date: 2013-05-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: HireFire.io - The Heroku Dyno Manager - Autoscaling your web and worker
14
14
  dynos saving you time and money!