Browse Source

Small optimization

Jordi Boggiano 6 years ago
parent
commit
7e272594e9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Packagist/WebBundle/Service/Scheduler.php

+ 1 - 1
src/Packagist/WebBundle/Service/Scheduler.php

@@ -57,7 +57,7 @@ class Scheduler
     private function getPendingUpdateJob(int $packageId, $updateEqualRefs = false, $deleteBefore = false)
     {
         $result = $this->doctrine->getManager()->getConnection()->fetchAssoc(
-            'SELECT id, payload FROM job WHERE packageId = :package AND type = :type AND status = :status',
+            'SELECT id, payload FROM job WHERE packageId = :package AND status = :status AND type = :type LIMIT 1',
             [
                 'package' => $packageId,
                 'type' => 'package:updates',