Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed Job #66

Closed
kagedwolf opened this issue Oct 31, 2012 · 1 comment
Closed

Delayed Job #66

kagedwolf opened this issue Oct 31, 2012 · 1 comment

Comments

@kagedwolf
Copy link

For the life of me, I can't figure out how to handle the delayed job daemon. You need to stop the daemon from the currently active release then start it from the new release path. How do you handle a failed release?

task :deploy => :environment do

  deploy do
    to :prepare do
      queue "cd #{deploy_to}/current && RAILS_ENV=production script/delayed_job stop"
    end

    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'

    to :launch do
      queue "touch #{deploy_to}/shared/tmp/restart.txt"
      queue "cd #{deploy_to}/current && RAILS_ENV=production script/delayed_job start"
    end

  end

end

Is this even close?

@kagedwolf
Copy link
Author

I think I was on the right track. It wouldn't stop the delayed job deamon because I had started it with sudo as a different user than my deploy user. Here is my latest.

task :deploy do

  deploy do
    to :prepare do
      queue "cd #{deploy_to}/current ; RAILS_ENV=production script/delayed_job stop"
    end

    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'

    to :launch do
      queue "cd #{deploy_to}/current ; mkdir -p tmp ; touch tmp/restart.txt"
      queue "cd #{deploy_to}/current ; mkdir -p tmp/pids ; RAILS_ENV=production script/delayed_job start"
    end

  end

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant