From 800770522110af8b220c92ca7b2c3fcb425ec745 Mon Sep 17 00:00:00 2001 From: Chris Boulton Date: Mon, 2 Feb 2015 12:27:28 -0800 Subject: [PATCH] return false when job creation is cancelled by beforeEnqueue --- lib/Resque.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Resque.php b/lib/Resque.php index 908b63e..db7d4f8 100644 --- a/lib/Resque.php +++ b/lib/Resque.php @@ -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);