mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-21 16:01:53 +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;
|
||||
}
|
||||
|
||||
$logger = new Resque_Log($logLevel);
|
||||
|
||||
$APP_INCLUDE = getenv('APP_INCLUDE');
|
||||
if($APP_INCLUDE) {
|
||||
if(!file_exists($APP_INCLUDE)) {
|
||||
@ -61,6 +59,12 @@ if($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;
|
||||
|
||||
$interval = 5;
|
||||
@ -92,7 +96,7 @@ if($count > 1) {
|
||||
else if(!$pid) {
|
||||
$queues = explode(',', $QUEUE);
|
||||
$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));
|
||||
$worker->work($interval, $BLOCKING);
|
||||
break;
|
||||
@ -103,7 +107,7 @@ if($count > 1) {
|
||||
else {
|
||||
$queues = explode(',', $QUEUE);
|
||||
$worker = new Resque_Worker($queues);
|
||||
$worker->setLogger(new Resque_Log($logLevel));
|
||||
$worker->setLogger($logger);
|
||||
|
||||
$PIDFILE = getenv('PIDFILE');
|
||||
if ($PIDFILE) {
|
||||
|
Loading…
Reference in New Issue
Block a user