mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 00:11:53 +00:00
return false when job creation is cancelled by beforeEnqueue
This commit is contained in:
parent
2308c3ced4
commit
8007705221
@ -197,7 +197,7 @@ class Resque
|
||||
* @param array $args Any optional arguments that should be passed when the job is executed.
|
||||
* @param boolean $trackStatus Set to true to be able to monitor the status of a job.
|
||||
*
|
||||
* @return string
|
||||
* @return string|boolean Job ID when the job was created, false if creation was cancelled due to beforeEnqueue
|
||||
*/
|
||||
public static function enqueue($queue, $class, $args = null, $trackStatus = false)
|
||||
{
|
||||
@ -212,7 +212,7 @@ class Resque
|
||||
Resque_Event::trigger('beforeEnqueue', $hookParams);
|
||||
}
|
||||
catch(Resque_Job_DontCreate $e) {
|
||||
return $id;
|
||||
return false;
|
||||
}
|
||||
|
||||
Resque_Job::create($queue, $class, $args, $trackStatus, $id);
|
||||
|
Loading…
Reference in New Issue
Block a user