Browse Source

Always bump the crawl date even if update failure was already notified

Jordi Boggiano 5 years ago
parent
commit
3150f30ba9
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/Packagist/WebBundle/Model/PackageManager.php

+ 6 - 5
src/Packagist/WebBundle/Model/PackageManager.php

@@ -158,13 +158,14 @@ class PackageManager
             }
 
             $package->setUpdateFailureNotified(true);
-            // make sure the package crawl time is updated so we avoid retrying failing packages more often than working ones
-            if (!$package->getCrawledAt() || $package->getCrawledAt() < new \DateTime()) {
-                $package->setCrawledAt(new \DateTime);
-            }
-            $this->doctrine->getEntityManager()->flush();
         }
 
+        // make sure the package crawl time is updated so we avoid retrying failing packages more often than working ones
+        if (!$package->getCrawledAt() || $package->getCrawledAt() < new \DateTime()) {
+            $package->setCrawledAt(new \DateTime);
+        }
+        $this->doctrine->getEntityManager()->flush();
+
         return true;
     }