Skip to content

Instantly share code, notes, and snippets.

View iboard's full-sized avatar
🏠
Crafting beautiful code at home

Andreas Altendorfer iboard

🏠
Crafting beautiful code at home
View GitHub Profile
@iboard
iboard / restart_rails_app_and_jobs_worker.thor
Created December 15, 2010 01:33
Restart your passanger-Rails app and delayed_job-workers
#
# Description at http://r3.iboard.cc/postings/30
#
class Application < Thor
desc "restart [--worker_only]", "kill 'rake jobs:work' and 'touch tmp/restart.txt'"
method_options :worker_only => :boolean
def restart
kill_pid("ps x|grep 'rake jobs:work'|grep -v grep")
unless options[:worker_only]