Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: resque/resque
...
head fork: jlecour/resque
compare: master
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 4 deletions.
  1. +11 −3 examples/demo/config.ru
  2. +1 −1  examples/monit/resque.monit
14 examples/demo/config.ru
View
@@ -7,10 +7,18 @@ require 'resque/server'
use Rack::ShowExceptions
# Set the AUTH env variable to your basic auth password to protect Resque.
-AUTH_PASSWORD = ENV['AUTH']
-if AUTH_PASSWORD
+# If it contains a ":" it's split (at the first ":")
+# to have a username and a password,
+# otherwise, it's just the password, and any username will work.
+CREDENTIALS = ENV['AUTH']
+if CREDENTIALS
Resque::Server.use Rack::Auth::Basic do |username, password|
- password == AUTH_PASSWORD
+ credentials = CREDENTIALS.split(':',2)
+ if credentials.size == 2
+ [username, password] == credentials
+ else
+ password == credentials[0]
+ end
end
end
2  examples/monit/resque.monit
View
@@ -1,6 +1,6 @@
check process resque_worker_QUEUE
with pidfile /data/APP_NAME/current/tmp/pids/resque_worker_QUEUE.pid
- start program = "/bin/sh -c 'cd /data/APP_NAME/current; nohup rake environment resque:work RAILS_ENV=production QUEUE=queue_name VERBOSE=1 PIDFILE=tmp/pids/resque_worker_QUEUE.pid &> log/resque_worker_QUEUE.log" as uid deploy and gid deploy
+ start program = "/bin/sh -c 'cd /data/APP_NAME/current; nohup rake environment resque:work RAILS_ENV=production QUEUE=queue_name VERBOSE=1 PIDFILE=tmp/pids/resque_worker_QUEUE.pid &> log/resque_worker_QUEUE.log'" as uid deploy and gid deploy
stop program = "/bin/sh -c 'cd /data/APP_NAME/current && kill -s QUIT `cat tmp/pids/resque_worker_QUEUE.pid` && rm -f tmp/pids/resque_worker_QUEUE.pid; exit 0;'"
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
group resque_workers

No commit comments for this range

Something went wrong with that request. Please try again.