mirror of
https://github.com/idanoo/php-resque
synced 2025-06-30 21:22:20 +00:00
return false when job creation is cancelled by beforeEnqueue
This commit is contained in:
parent
2308c3ced4
commit
8007705221
1 changed files with 2 additions and 2 deletions
|
@ -197,7 +197,7 @@ class Resque
|
||||||
* @param array $args Any optional arguments that should be passed when the job is executed.
|
* @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.
|
* @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)
|
public static function enqueue($queue, $class, $args = null, $trackStatus = false)
|
||||||
{
|
{
|
||||||
|
@ -212,7 +212,7 @@ class Resque
|
||||||
Resque_Event::trigger('beforeEnqueue', $hookParams);
|
Resque_Event::trigger('beforeEnqueue', $hookParams);
|
||||||
}
|
}
|
||||||
catch(Resque_Job_DontCreate $e) {
|
catch(Resque_Job_DontCreate $e) {
|
||||||
return $id;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Resque_Job::create($queue, $class, $args, $trackStatus, $id);
|
Resque_Job::create($queue, $class, $args, $trackStatus, $id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue