Skip to content

Commit

Permalink
Add a notes regarding ruby >= 1.9 requirement for BACKGROUND
Browse files Browse the repository at this point in the history
  • Loading branch information
cleishm committed Aug 24, 2011
1 parent 39d51cb commit dcfbe36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.markdown
Expand Up @@ -267,9 +267,10 @@ worker process. Use the PIDFILE option for easy access to the PID:

### Running in the background

There are scenarios where it's helpful for the resque worker to run
itself in the background (usually in combination with PIDFILE). Use the
BACKGROUND option so that rake will return as soon as the worker is started.
(Only supported with ruby >= 1.9). There are scenarios where it's helpful for
the resque worker to run itself in the background (usually in combination with
PIDFILE). Use the BACKGROUND option so that rake will return as soon as the
worker is started.

$ PIDFILE=./resque.pid BACKGROUND=yes QUEUE=file_serve \
rake environment resque:work
Expand Down
3 changes: 3 additions & 0 deletions lib/resque/tasks.rb
Expand Up @@ -19,6 +19,9 @@
end

if ENV['BACKGROUND']
unless Process.respond_to?('daemon')
abort "env var BACKGROUND is set, which requires ruby >= 1.9"
end
Process.daemon(true)
end

Expand Down

0 comments on commit dcfbe36

Please sign in to comment.