Skip to content

Commit d5c3403

Browse files
yaauiesteveklabnik
authored andcommitted
reimplement ono/resque@6790e8c3328 using separate task
1 parent 5ba33f5 commit d5c3403

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/resque/tasks.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
task :setup
66

77
desc "Start a Resque worker"
8-
task :work => :setup do
8+
task :work => [:pidfile, :setup] do
99
require 'resque'
1010

1111
queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')
@@ -26,10 +26,6 @@
2626
Process.daemon(true)
2727
end
2828

29-
if ENV['PIDFILE']
30-
File.open(ENV['PIDFILE'], 'w') { |f| f << worker.pid }
31-
end
32-
3329
worker.log "Starting worker #{worker}"
3430

3531
worker.work(ENV['INTERVAL'] || 5) # interval, will block

0 commit comments

Comments
 (0)