resque-status 0.4.2 → 0.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 323c2f3b3316e4beac0112382865580010032cd9
4
- data.tar.gz: bed8bbe784ec2165cd79b9e92b035456e45890ce
3
+ metadata.gz: 7a4382134fbba02bad15ec7adb476b1f1d14ec29
4
+ data.tar.gz: 239fa4abd391dcc1d7b48ff8500d700feb894d82
5
5
  SHA512:
6
- metadata.gz: 0a2dd540a7e6be2758f84b0150c3a165f5bc8b439131327e3174a87a697a409b617c73cb572855a2347cca4f4723d8fc3d2e666a711c7fa2e9d84a4444bf269f
7
- data.tar.gz: 0b991464b6f793b216b518586b6b23a20ffc19ce2c89265f9af571e88bb085ae1e12eb6a5d2a8a6e6bb2192273f0849286973aaddc6ba1a8d73fc557347a8c47
6
+ metadata.gz: c3f7917eac96cd4d2db4612ca93b5c000165b372a69457e501b0e1a0af9f82cdbdcd82a390cca7c3331cd3f4228717cd1d18575729fcb9deaa6c5a2cd6462563
7
+ data.tar.gz: 814e1a1eee96821f0c663545990071da35684c32ce16476655d859943ef2a72f591ece87d0097d0d480e4fd5fcaa4507ef86171506e8f82bb0a3ef831d8d1da1
@@ -129,9 +129,17 @@ by UUID.
129
129
 
130
130
  Resque::Plugins::Status::Hash.kill(job_id)
131
131
 
132
- The next time the job at job_id calls <tt>at</tt> or tick, it will raise a Killed
132
+ The next time the job at job_id calls <tt>at</tt> or <tt>tick</tt>, it will raise a <tt>Killed</tt>
133
133
  error and set the status to killed.
134
134
 
135
+ === Percent Complete and setting the message
136
+
137
+ Use <tt>at</tt> or <tt>tick</tt> to show progress in your job's <tt>perform</tt> function
138
+ (which is displayed on the resque-web status tab). This will also be where <tt>Killed</tt>
139
+ is raised if the job is killed.
140
+
141
+ at(steps_completed, total_steps, "${steps_completed} of #{total_steps} steps completed!")
142
+
135
143
  === Expiration
136
144
 
137
145
  Since Redis is RAM based, we probably don't want to keep these statuses around forever
@@ -28,7 +28,7 @@ module Resque
28
28
  # This job would iterate num times updating the status as it goes. At the end
29
29
  # we update the status telling anyone listening to this job that its complete.
30
30
  module Status
31
- VERSION = '0.4.2'
31
+ VERSION = '0.4.3'
32
32
 
33
33
  STATUS_QUEUED = 'queued'
34
34
  STATUS_WORKING = 'working'
@@ -26,6 +26,7 @@ module Resque
26
26
 
27
27
  # Get multiple statuses by UUID. Returns array of Resque::Plugins::Status::Hash
28
28
  def self.mget(uuids)
29
+ return [] if uuids.empty?
29
30
  status_keys = uuids.map{|u| status_key(u)}
30
31
  vals = redis.mget(*status_keys)
31
32
 
@@ -86,7 +87,7 @@ module Resque
86
87
  # Resque::Plugins::Status::Hash.statuses(0, 20)
87
88
  def self.statuses(range_start = nil, range_end = nil)
88
89
  ids = status_ids(range_start, range_end)
89
- mget(ids).compact
90
+ mget(ids).compact || []
90
91
  end
91
92
 
92
93
  # Return the <tt>num</tt> most recent status/job UUIDs in reverse chronological order.
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: resque-status 0.4.2 ruby lib
5
+ # stub: resque-status 0.4.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "resque-status"
9
- s.version = "0.4.2"
9
+ s.version = "0.4.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Aaron Quint"]
14
- s.date = "2014-01-21"
14
+ s.date = "2014-05-12"
15
15
  s.description = "resque-status is an extension to the resque queue system that provides simple trackable jobs. It provides a Resque::Plugins::Status::Hash class which can set/get the statuses of jobs and a Resque::Plugins::Status class that when included provides easily trackable/killable jobs."
16
16
  s.email = "aaron@quirkey.com"
17
17
  s.extra_rdoc_files = [
@@ -189,6 +189,12 @@ class TestResquePluginsStatusHash < Test::Unit::TestCase
189
189
  assert_same_elements [@uuid_with_json, @uuid], statuses.collect {|s| s.uuid }
190
190
  end
191
191
 
192
+ should "return an empty array when no statuses are available" do
193
+ Resque.redis.flushall
194
+ statuses = Resque::Plugins::Status::Hash.statuses
195
+ assert_equal [], statuses
196
+ end
197
+
192
198
  end
193
199
 
194
200
  Resque::Plugins::Status::STATUSES.each do |status_code|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Quint
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-21 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque