require 'redis'
require 'resque'

if ARGV.size != 1
  puts "migrate_to_timestamps_set.rb <redis-host:redis-port>"
  exit
end

Resque.redis = ARGV[0]
redis = Resque.redis
Array(redis.keys("delayed:*")).each do |key|
  jobs = redis.lrange(key, 0, -1)
  jobs.each {|job| redis.sadd("timestamps:#{job}", key)}
end

Add a migration script to be used to migrate to the new job timestamps tracking on an existant resque-scheduler redis db.
Add a migration script to be used to migrate to
the new job timestamps tracking on an existant
resque-scheduler redis db.
