resque-delayed 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,16 @@
1
+ ## 1.1.0 (2011-09-23)
2
+
3
+ * well, this is embarrasing. originally added `@queue` instance variable to
4
+ `Resque::Delayed` metaclass by accident. relocated.
5
+
6
+ note: this means if you were using version 1.0.0 of the gem then your
7
+ Resque::Delayed queue is currently stored in the empty string key instead
8
+ of the "Resque::Delayed:internal" key. you can run
9
+
10
+ `$ bundle exec rake resque_delayed:migrate_queue_key`
11
+
12
+ to fix this.
13
+
1
14
  ## 1.0.0 (2011-09-07)
2
15
 
3
16
  * initial release.
@@ -1,8 +1,8 @@
1
1
  module Resque
2
2
  module Delayed
3
- class << self
4
- @queue = "Resque::Delayed:internal"
3
+ @queue = "Resque::Delayed:internal"
5
4
 
5
+ class << self
6
6
  def random_uuid
7
7
  UUIDTools::UUID.random_create.to_s.gsub('-', '')
8
8
  end
@@ -1,9 +1,19 @@
1
+ require 'resque-delayed'
2
+
1
3
  # require 'resque-delayed/tasks'
2
4
  namespace :resque_delayed do
3
5
 
4
6
  desc "Start a Resque::Delayed worker"
5
7
  task :work do
6
- require 'resque-delayed'
8
+ unless Resque.redis.instance_variable_get(:@redis).zcard("").zero?
9
+ STDERR.puts %Q{
10
+ WARNING: you have a sorted set stored at the empty string key in your redis instance
11
+ if you've just upgraded from Resque::Delayed 1.0.0 you probably want to run
12
+
13
+ $ bundle exec rake resque_delayed:migrate_queue key
14
+
15
+ see resque-delayed/CHANGELOG.md for details}
16
+ end
7
17
 
8
18
  begin
9
19
  worker = Resque::Delayed::Worker.new
@@ -19,4 +29,18 @@ namespace :resque_delayed do
19
29
 
20
30
  worker.work(ENV['INTERVAL'] || 5) # interval, will block
21
31
  end
32
+
33
+ desc "Migrate Resque::Delayed queue to new redis key after 1.1.0 upgrade"
34
+ task :migrate_queue_key do
35
+ redis = Resque.redis.instance_variable_get :@redis
36
+
37
+ old_key = ""
38
+ new_key = "resque:Resque::Delayed:internal"
39
+
40
+ redis.zrange(old_key, 0, -1, :withscores => true).each_slice(2).each do |key, score|
41
+ redis.zadd new_key, score, key
42
+ end
43
+
44
+ redis.del old_key
45
+ end
22
46
  end
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module Delayed
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: resque-delayed
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Justin Giancola
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-07 00:00:00 Z
13
+ date: 2011-09-29 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- hash: -4057691847375928239
132
+ hash: -2887856198374763770
133
133
  segments:
134
134
  - 0
135
135
  version: "0"
@@ -138,14 +138,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - ">="
140
140
  - !ruby/object:Gem::Version
141
- hash: -4057691847375928239
141
+ hash: -2887856198374763770
142
142
  segments:
143
143
  - 0
144
144
  version: "0"
145
145
  requirements: []
146
146
 
147
147
  rubyforge_project:
148
- rubygems_version: 1.8.8
148
+ rubygems_version: 1.8.10
149
149
  signing_key:
150
150
  specification_version: 3
151
151
  summary: Delayed job queueing for Resque