@@ -72,12 +72,12 @@ public static function redis()
72
72
*
73
73
* Will close connection to Redis before forking.
74
74
*
75
- * @return int Return vars as per pcntl_fork()
75
+ * @return int Return vars as per pcntl_fork(). False if pcntl_fork is unavailable
76
76
*/
77
77
public static function fork ()
78
78
{
79
79
if (!function_exists ('pcntl_fork ' )) {
80
- return - 1 ;
80
+ return false ;
81
81
}
82
82
83
83
// Close the connection to Redis before forking.
@@ -281,12 +281,12 @@ private static function removeItems($queue, $items = Array())
281
281
$ originalQueue = 'queue: ' . $ queue ;
282
282
$ tempQueue = $ originalQueue . ':temp: ' . time ();
283
283
$ requeueQueue = $ tempQueue . ':requeue ' ;
284
-
284
+
285
285
// move each item from original queue to temp queue and process it
286
286
$ finished = false ;
287
287
while (!$ finished ) {
288
288
$ string = self ::redis ()->rpoplpush ($ originalQueue , self ::redis ()->getPrefix () . $ tempQueue );
289
-
289
+
290
290
if (!empty ($ string )) {
291
291
if (self ::matchItem ($ string , $ items )) {
292
292
self ::redis ()->rpop ($ tempQueue );
@@ -311,7 +311,7 @@ private static function removeItems($queue, $items = Array())
311
311
// remove temp queue and requeue queue
312
312
self ::redis ()->del ($ requeueQueue );
313
313
self ::redis ()->del ($ tempQueue );
314
-
314
+
315
315
return $ counter ;
316
316
}
317
317
@@ -377,4 +377,3 @@ public static function generateJobId()
377
377
return md5 (uniqid ('' , true ));
378
378
}
379
379
}
380
-
0 commit comments