Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/69/head
Maxence Lange 2018-11-28 14:27:38 -01:00
rodzic 005a8c57d0
commit 676ec5acce
4 zmienionych plików z 9 dodań i 7 usunięć

Wyświetl plik

@ -420,7 +420,6 @@ class LocalController extends Controller {
$cached = [];
foreach ($documents as $id) {
try {
$document = $this->documentService->cacheRemoteDocument($id);
$cached[] = $document;
} catch (Exception $e) {

Wyświetl plik

@ -151,7 +151,7 @@ class CacheDocumentsRequest extends CacheDocumentsRequestBuilder {
$this->limitToDBFieldEmpty($qb, 'local_copy');
$this->limitToCaching($qb, self::CACHE_TTL);
$this->limitToDBFieldInt($qb, 'error', 0);
$documents = [];
$cursor = $qb->execute();
while ($data = $cursor->fetch()) {

Wyświetl plik

@ -363,9 +363,10 @@ class CoreRequestBuilder {
/**
* @param IQueryBuilder $qb
* @param string $order
*/
protected function orderByPriority(IQueryBuilder &$qb) {
$qb->orderBy('priority', 'desc');
protected function orderByPriority(IQueryBuilder &$qb, string $order = 'desc') {
$qb->orderBy('priority', $order);
}

Wyświetl plik

@ -180,9 +180,11 @@ class RequestQueueRequest extends RequestQueueRequestBuilder {
*/
public function setAsFailure(RequestQueue &$queue) {
$qb = $this->getQueueUpdateSql();
$qb->set('status', $qb->createNamedParameter(RequestQueue::STATUS_STANDBY));
// TODO - increment tries++
// ->set('tries', 'tries+1');
$func = $qb->func();
$expr = $qb->expr();
$qb->set('status', $qb->createNamedParameter(RequestQueue::STATUS_STANDBY))
->set('tries', $func->add('tries', $expr->literal(1)));
$this->limitToId($qb, $queue->getId());
$this->limitToStatus($qb, RequestQueue::STATUS_RUNNING);