We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78273c2 commit 60b157dCopy full SHA for 60b157d
lib/resque/tasks.rb
@@ -18,6 +18,10 @@
18
abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
19
end
20
21
+ if ENV['BACKGROUND']
22
+ Process.daemon(true)
23
+ end
24
+
25
if ENV['PIDFILE']
26
File.open(ENV['PIDFILE'], 'w') { |f| f << worker.pid }
27
lib/resque/worker.rb
@@ -470,7 +470,7 @@ def hostname
470
471
# Returns Integer PID of running worker
472
def pid
473
- @pid ||= to_s.split(":")[1].to_i
+ Process.pid
474
475
476
# Returns an Array of string pids of all the other workers on this
0 commit comments