resque-aps 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.9.7 (2010-07-26)
2
+
3
+ * Add a rake task to get the lengths of the application queues.
4
+
1
5
  ## 0.9.6 (2010-07-23)
2
6
 
3
7
  * Fixed the revoked or expired exception identification code
@@ -4,11 +4,21 @@
4
4
  namespace :resque do
5
5
  task :setup
6
6
 
7
- desc "Queue an APN in Resque"
8
- task :aps => :setup do
9
- require 'resque'
10
- require 'resque_aps'
7
+ namespace :aps do
8
+ desc "Retrieve the current queue lengths"
9
+ task :queue_lengths => :setup do
10
+ require 'resque'
11
+ require 'resque_aps'
11
12
 
13
+ if Resque.aps_applications_count > 0
14
+ puts "## START ##"
15
+ Resque.aps_application_names(0,0).each do |app|
16
+ puts "#{app}:#{Resque.aps_notification_count_for_application(app)}"
17
+ end
18
+ else
19
+ abort "None"
20
+ end
21
+ end
12
22
  end
13
23
 
14
24
  end
@@ -1,3 +1,3 @@
1
1
  module ResqueAps
2
- Version = '0.9.6'
2
+ Version = '0.9.7'
3
3
  end
data/lib/resque_aps.rb CHANGED
@@ -114,6 +114,7 @@ module ResqueAps
114
114
  # Returns an array of applications based on start and count
115
115
  def aps_application_names(start = 0, count = 1)
116
116
  a = redis.smembers(:aps_applications)
117
+ return a if count == 0
117
118
  ret = a[start..(start + count)]
118
119
  return [] unless ret
119
120
  ret
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 6
9
- version: 0.9.6
8
+ - 7
9
+ version: 0.9.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ashley Martens
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-23 00:00:00 -07:00
17
+ date: 2010-07-26 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency