-
-
Save dsaveliev/6668882 to your computer and use it in GitHub Desktop.
Revisions
-
denmarkin revised this gist
Sep 20, 2011 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,17 @@ namespace :resque do task :clear => :environment do queues = Resque.queues queues.each do |queue_name| puts "Clearing #{queue_name}..." Resque.redis.del "queue:#{queue_name}" end puts "Clearing delayed..." # in case of scheduler - doesn't break if no scheduler module is installed Resque.redis.keys("delayed:*").each do |key| Resque.redis.del "#{key}" end Resque.redis.del "delayed_queue_schedule" puts "Clearing stats..." Resque.redis.set "stat:failed", 0 Resque.redis.set "stat:processed", 0 end -
denmarkin revised this gist
Sep 20, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ namespace :resque do desc "Clear pending tasks" task :clear => :environment do queues = Resque.queues queues.each do |queue_name| puts "Cleaning #{queue_name}..." Resque.redis.del "queue:#{queue_name}" -
denmarkin created this gist
Sep 20, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version # see https://github.com/defunkt/resque/issues/49 # see http://redis.io/commands - new commands namespace :resque do desc "Clear pending tasks" task :clear => :environment do queues = [:followups, :experts, :feedbacks, :invitations, :payouts, :questions, :notifications] # list your queues here queues.each do |queue_name| puts "Cleaning #{queue_name}..." Resque.redis.del "queue:#{queue_name}" end puts "Cleaning stats..." Resque.redis.set "stat:failed", 0 Resque.redis.set "stat:processed", 0 end end