* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @author Aaron Schulz
*/
use Psr\Log\LoggerInterface;
/** @var string Compression method to use */
protected $compression;
+ const MAX_PUSH_SIZE = 25; // avoid tying up the server
+
/**
* @param array $params Possible keys:
* - redisConfig : An array of parameters to RedisConnectionPool::__construct().
protected function doGetSize() {
$conn = $this->getConnection();
try {
- return $conn->lSize( $this->getQueueKey( 'l-unclaimed' ) );
+ return $conn->lLen( $this->getQueueKey( 'l-unclaimed' ) );
} catch ( RedisException $e ) {
$this->throwRedisException( $conn, $e );
}
if ( $flags & self::QOS_ATOMIC ) {
$batches = [ $items ]; // all or nothing
} else {
- $batches = array_chunk( $items, 100 ); // avoid tying up the server
+ $batches = array_chunk( $items, self::MAX_PUSH_SIZE );
}
$failed = 0;
$pushed = 0;
$keys[] = $this->getQueueKey( $prop );
}
- $ok = ( $conn->delete( $keys ) !== false );
+ $ok = ( $conn->del( $keys ) !== false );
$conn->sRem( $this->getGlobalKey( 's-queuesWithJobs' ), $this->encodeQueueName() );
return $ok;
try {
$conn->multi( Redis::PIPELINE );
foreach ( $types as $type ) {
- $conn->lSize( $this->getQueueKey( 'l-unclaimed', $type ) );
+ $conn->lLen( $this->getQueueKey( 'l-unclaimed', $type ) );
}
$res = $conn->exec();
if ( is_array( $res ) ) {