Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 3 files changed
  • 2 commit comments
  • 1 contributor
Showing with 10 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +7 −0 README.markdown
  3. +2 −1 lib/resque/tasks.rb
View
1 .gitignore
@@ -1,2 +1,3 @@
pkg
nbproject
+.idea
View
7 README.markdown
@@ -235,6 +235,13 @@ variable.
$ VVERBOSE=1 QUEUE=file_serve rake environment resque:work
+### Process IDs (PIDs)
+
+There are scenarios where it's helpful to record the PID of a resque
+worker process. Use the PIDFILE option for easy access to the PID:
+
+ $ PIDFILE=./resque.pid QUEUE=file_serve rake environment resque:work
+
### Priorities and Queue Lists
View
3 lib/resque/tasks.rb
@@ -8,7 +8,6 @@
task :work => :setup do
require 'resque'
- worker = nil
queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')
begin
@@ -19,6 +18,8 @@
abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
end
+ File.open(ENV['PIDFILE'], 'w') { |f| f << Process.pid.to_s } if ENV['PIDFILE']
+
worker.log "Starting worker #{worker}"
worker.work(ENV['INTERVAL'] || 5) # interval, will block

Showing you all comments on commits in this comparison.

@defunkt

If you add this to a global gitignore it'll work across all your projects. See github/gitignore's README

@christiannelson

Sweet. Thanks for the tip... this is super helpful since I'm dealing with new repos all the time.

Something went wrong with that request. Please try again.