Skip to content

Commit df493a2

Browse files
author
Aaron Patterson and Terence Lee
committed
fix resque start task
apply changes from Resque::Queue.new changes move worker settings out of begin block, since they shouldn't raise ArgumentError
1 parent 0a02a0c commit df493a2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/resque/tasks.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')
1212

1313
begin
14-
worker = Resque::Worker.new(*queues)
15-
worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
16-
worker.very_verbose = ENV['VVERBOSE']
17-
worker.term_timeout = ENV['RESQUE_TERM_TIMEOUT'] || 4.0
18-
rescue Resque::NoQueueError
14+
worker = Resque::Worker.new(queues)
15+
rescue ArgumentError
1916
abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
2017
end
2118

19+
worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
20+
worker.very_verbose = ENV['VVERBOSE']
21+
worker.term_timeout = ENV['RESQUE_TERM_TIMEOUT'] || 4.0
22+
2223
if ENV['BACKGROUND']
2324
unless Process.respond_to?('daemon')
2425
abort "env var BACKGROUND is set, which requires ruby >= 1.9"

0 commit comments

Comments
 (0)