Skip to content

Commit

Permalink
feature(hooks): детальное название процесса
Browse files Browse the repository at this point in the history
Для того, чтобы смотреть в top и сразу понимать, что за джоб жрёт память
  • Loading branch information
bibendi committed Sep 3, 2013
1 parent c622fce commit 27feb40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/resque/integration/tasks/hooks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ namespace :resque do

# Нужно также закрыть соединение к memcache
Resque.before_first_fork { Rails.cache.reset if Rails.cache.respond_to?(:reset) }

# Красиво нарисуем название процесса
Resque.after_fork { |job| $0 = "Resque q:#{job.queue}, j:#{job.payload['class']}, since:#{Time.now.to_s(:db)}" }

# Support for resque-multi-job-forks
if ENV['JOBS_PER_FORK'] || ENV['MINUTES_PER_FORK']
#require 'resque-multi-job-forks'
end
end
end
end

0 comments on commit 27feb40

Please sign in to comment.