Sha256: 3239b2288945c209123f4da24949b237646abc513111f7f2cfbc203d1915b8b7

Contents?: true

Size: 338 Bytes

Versions: 7

Compression:

Stored size: 338 Bytes

Contents

# vim:fileencoding=utf-8

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
resque_admin-scheduler-1.0.2 bin/migrate_to_timestamps_set.rb
resque-scheduler-4.2.1 script/migrate_to_timestamps_set.rb
resque-scheduler-4.2.0 script/migrate_to_timestamps_set.rb
resque-scheduler-4.1.0 script/migrate_to_timestamps_set.rb
resque-scheduler-4.0.0 script/migrate_to_timestamps_set.rb
resque-scheduler-3.1.0 script/migrate_to_timestamps_set.rb
resque-scheduler-3.0.0 script/migrate_to_timestamps_set.rb