Переглянути джерело

Keep dev-versions up to date for valid branches

Anton Minin 10 роки тому
батько
коміт
03379157f0
1 змінених файлів з 3 додано та 4 видалено
  1. 3 4
      src/Packagist/WebBundle/Package/Updater.php

+ 3 - 4
src/Packagist/WebBundle/Package/Updater.php

@@ -98,10 +98,6 @@ class Updater
         $versions = $repository->getPackages();
         $em = $this->doctrine->getManager();
 
-        if ($repository->hadInvalidBranches()) {
-            throw new InvalidRepositoryException('Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches');
-        }
-
         usort($versions, function ($a, $b) {
             $aVersion = $a->getVersion();
             $bVersion = $b->getVersion();
@@ -169,6 +165,9 @@ class Updater
         $package->setUpdatedAt(new \DateTime);
         $package->setCrawledAt(new \DateTime);
         $em->flush();
+        if ($repository->hadInvalidBranches()) {
+            throw new InvalidRepositoryException('Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches');
+        }
     }
 
     private function updateInformation(Package $package, PackageInterface $data, $flags)