Skip to content
Newer
Older
100644 24 lines (18 sloc) 612 Bytes
5520cba @huacnlee update to Rails3 and created tables
huacnlee authored
1 # Add your own tasks in files placed in lib/tasks ending in .rake,
2 # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
4 require File.expand_path('../config/application', __FILE__)
5 require 'rake'
26d3a8f @huacnlee Mail notify done.
huacnlee authored
6 require 'resque/tasks'
5520cba @huacnlee update to Rails3 and created tables
huacnlee authored
7
5aa19a6 @huacnlee Add Posts feature
huacnlee authored
8 RubyChina::Application.load_tasks
279ec07 @huacnlee Resque run as daemon with script/resque
huacnlee authored
9
10 namespace :resque do
11 task :restart_workers => :environment do
12 pids = Array.new
13
14 Resque.workers.each do |worker|
15 pids << worker.to_s.split(/:/).second
16 end
17
18 if pids.size > 0
19 system("kill -QUIT #{pids.join(' ')}")
20 end
21
22 system("rm /var/run/god/resque-1.8.0*.pid")
23 end
24 end
Something went wrong with that request. Please try again.