From 27feb408d57012237199a54b60dd6ad471acea59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B5=D1=80=D0=BA=D1=83=D1=88=D0=B8=D0=BD=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Tue, 3 Sep 2013 12:28:47 +0600 Subject: [PATCH] =?UTF-8?q?feature(hooks):=20=D0=B4=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Для того, чтобы смотреть в top и сразу понимать, что за джоб жрёт память --- lib/resque/integration/tasks/hooks.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/resque/integration/tasks/hooks.rake b/lib/resque/integration/tasks/hooks.rake index 45ebcaf..2a5bea9 100644 --- a/lib/resque/integration/tasks/hooks.rake +++ b/lib/resque/integration/tasks/hooks.rake @@ -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 \ No newline at end of file +end