Skip to content

Commit

Permalink
rake task for logs rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Jan 9, 2014
1 parent 8649547 commit dd8679c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/resque/integration/tasks/resque.rake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ namespace :resque do
puts `#{god} status resque`
end

namespace :logs do
desc 'Rotate resque logs'
task :rotate do
return unless god_running?

Process.kill('USR1', File.read(pid_file).to_i)
sleep 3
puts `#{god} signal resque HUP`
end
end

private
def god
`which god`.strip
Expand Down

0 comments on commit dd8679c

Please sign in to comment.