Trying to run redis and resque scheduler as part of a rake task

I want to run redis and redis-scheduler from a rake task, so I do the following:

namespace :raketask do
  task :start do
    system("QUEUE=* rake resque:work &")
    system("rake redis:start")
    system("rake resque:scheduler")
  end
end

The problem is that redis starts in the foreground and then it never starts the scheduler. If it does not start in the background (using &). The scheduler must be running AFTER resuming operation.

+3
source share
2 answers

similar to nirvdrum. Resque workers are about to fail / fail if redis is not already running and is not accepting the connection.

check this example on an example of how to get started with monit (linux stuff).

Monit , , , .pid.

+1

. redis init script - . , , , , redis: start, nohup , TTY .

0

All Articles