Skip to content

Commit 8007705

Browse files
committed
return false when job creation is cancelled by beforeEnqueue
1 parent 2308c3c commit 8007705

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Resque.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static function size($queue)
197197
* @param array $args Any optional arguments that should be passed when the job is executed.
198198
* @param boolean $trackStatus Set to true to be able to monitor the status of a job.
199199
*
200-
* @return string
200+
* @return string|boolean Job ID when the job was created, false if creation was cancelled due to beforeEnqueue
201201
*/
202202
public static function enqueue($queue, $class, $args = null, $trackStatus = false)
203203
{
@@ -212,7 +212,7 @@ public static function enqueue($queue, $class, $args = null, $trackStatus = fals
212212
Resque_Event::trigger('beforeEnqueue', $hookParams);
213213
}
214214
catch(Resque_Job_DontCreate $e) {
215-
return $id;
215+
return false;
216216
}
217217

218218
Resque_Job::create($queue, $class, $args, $trackStatus, $id);

0 commit comments

Comments
 (0)