mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 08:15:14 +00:00
Look for a var in the bin/resque script to allow override
This commit is contained in:
parent
726e58a297
commit
5cef885a06
12
bin/resque
12
bin/resque
@ -50,8 +50,6 @@ else if(!empty($VVERBOSE)) {
|
|||||||
$logLevel = true;
|
$logLevel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$logger = new Resque_Log($logLevel);
|
|
||||||
|
|
||||||
$APP_INCLUDE = getenv('APP_INCLUDE');
|
$APP_INCLUDE = getenv('APP_INCLUDE');
|
||||||
if($APP_INCLUDE) {
|
if($APP_INCLUDE) {
|
||||||
if(!file_exists($APP_INCLUDE)) {
|
if(!file_exists($APP_INCLUDE)) {
|
||||||
@ -61,6 +59,12 @@ if($APP_INCLUDE) {
|
|||||||
require_once $APP_INCLUDE;
|
require_once $APP_INCLUDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See if the APP_INCLUDE containes a logger object,
|
||||||
|
// If none exists, fallback to internal logger
|
||||||
|
if (!isset($logger) && !is_object($logger)) {
|
||||||
|
$logger = new Resque_Log($logLevel);
|
||||||
|
}
|
||||||
|
|
||||||
$BLOCKING = getenv('BLOCKING') !== FALSE;
|
$BLOCKING = getenv('BLOCKING') !== FALSE;
|
||||||
|
|
||||||
$interval = 5;
|
$interval = 5;
|
||||||
@ -92,7 +96,7 @@ if($count > 1) {
|
|||||||
else if(!$pid) {
|
else if(!$pid) {
|
||||||
$queues = explode(',', $QUEUE);
|
$queues = explode(',', $QUEUE);
|
||||||
$worker = new Resque_Worker($queues);
|
$worker = new Resque_Worker($queues);
|
||||||
$worker->setLogger(new Resque_Log($logLevel));
|
$worker->setLogger($logger);
|
||||||
$logger->log(Psr\Log\LogLevel::NOTICE, 'Starting worker {worker}', array('worker' => $worker));
|
$logger->log(Psr\Log\LogLevel::NOTICE, 'Starting worker {worker}', array('worker' => $worker));
|
||||||
$worker->work($interval, $BLOCKING);
|
$worker->work($interval, $BLOCKING);
|
||||||
break;
|
break;
|
||||||
@ -103,7 +107,7 @@ if($count > 1) {
|
|||||||
else {
|
else {
|
||||||
$queues = explode(',', $QUEUE);
|
$queues = explode(',', $QUEUE);
|
||||||
$worker = new Resque_Worker($queues);
|
$worker = new Resque_Worker($queues);
|
||||||
$worker->setLogger(new Resque_Log($logLevel));
|
$worker->setLogger($logger);
|
||||||
|
|
||||||
$PIDFILE = getenv('PIDFILE');
|
$PIDFILE = getenv('PIDFILE');
|
||||||
if ($PIDFILE) {
|
if ($PIDFILE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user