Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

Commit

Permalink
change to the current_path before running commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydpick committed Aug 17, 2011
1 parent f698e64 commit ca32ee8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/resque_utils/capistrano.rb
Expand Up @@ -8,20 +8,20 @@

desc "Requeue all failed jobs"
task :requeue_all do
set :resque_pre, "#{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
set :resque_pre, "cd #{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
run "#{resque_pre} 'ResqueUtils::requeue_all'"
end

desc "Remove all failed jobs"
task :remove_all do
set :resque_pre, "#{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
set :resque_pre, "cd #{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
run "#{resque_pre} 'ResqueUtils::remove_all'"
end

desc "Requeue specific failed jobs (specify with '--set exception=SomeErrorHere)"
task :requeue_specific do
if exists?(:exception)
set :resque_pre, "#{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
set :resque_pre, "cd #{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
run "#{resque_pre} \"ResqueUtils::requeue_all('#{exception}')\""
else
raise ArgumentError, "No exception was specified, use '--set exception=SomeErrorHere'"
Expand All @@ -31,7 +31,7 @@
desc "Remove specific failed jobs (specify with '--set exception=SomeErrorHere)"
task :remove_specific do
if exists?(:exception)
set :resque_pre, "#{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
set :resque_pre, "cd #{current_path} && RAILS_ENV=#{environment} bundle exec rails runner"
run "#{resque_pre} \"ResqueUtils::remove_all('#{exception}')\""
else
raise ArgumentError, "No exception was specified, use '--set exception=SomeErrorHere'"
Expand Down

0 comments on commit ca32ee8

Please sign in to comment.