mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 00:11:53 +00:00
Add ability to fetch wildcarded list of queues a worker belongs to without it expanding them out using redis
This commit is contained in:
parent
6f43fcfed8
commit
3245c523c7
@ -274,13 +274,15 @@ class Resque_Worker
|
|||||||
* when searching for jobs.
|
* when searching for jobs.
|
||||||
*
|
*
|
||||||
* If * is found in the list of queues, every queue will be searched in
|
* If * is found in the list of queues, every queue will be searched in
|
||||||
* alphabetic order.
|
* alphabetic order. (@see $fetch)
|
||||||
*
|
*
|
||||||
|
* @param boolean $fetch If true, and the queue is set to *, will fetch
|
||||||
|
* all queue names from redis.
|
||||||
* @return array Array of associated queues.
|
* @return array Array of associated queues.
|
||||||
*/
|
*/
|
||||||
public function queues()
|
public function queues($fetch = true)
|
||||||
{
|
{
|
||||||
if(!in_array('*', $this->queues)) {
|
if(!in_array('*', $this->queues) || $fetch == false) {
|
||||||
return $this->queues;
|
return $this->queues;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +319,7 @@ class Resque_Worker
|
|||||||
{
|
{
|
||||||
$this->registerSigHandlers();
|
$this->registerSigHandlers();
|
||||||
$this->pruneDeadWorkers();
|
$this->pruneDeadWorkers();
|
||||||
Resque_Event::trigger('beforeFirstFork');
|
Resque_Event::trigger('beforeFirstFork', $this);
|
||||||
$this->registerWorker();
|
$this->registerWorker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user