const QoS_Atomic = 1; // integer; "all-or-nothing" job insertions
+ const MAX_ATTEMPTS = 3; // integer; number of times to try a job
+
/**
* @param $params array
*/
* If "random" is used, pop() will pick jobs in random order. This might be
* useful for improving concurrency depending on the queue storage medium.
* - claimTTL : If supported, the queue will recycle jobs that have been popped
- * but not acknowledged as completed after this many seconds.
+ * but not acknowledged as completed after this many seconds. Recycling
+ * of jobs simple means re-inserting them into the queue. Jobs can be
+ * attempted up to three times before being discarded.
*
* Queue classes should throw an exception if they do not support the options given.
*
const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed
- const MAX_ATTEMPTS = 3; // integer; number of times to try a job
const MAX_JOB_RANDOM = 2147483647; // integer; 2^31 - 1, used for job_random
const MAX_OFFSET = 255; // integer; maximum number of rows to skip
$t = microtime( true );
$this->runJobsLog( $job->toString() . " STARTING" );
$status = $job->run();
- $group->ack( $job ); // done
+ if ( $status ) {
+ $group->ack( $job ); // done
+ }
$t = microtime( true ) - $t;
$timeMs = intval( $t * 1000 );
if ( !$status ) {