Sfoglia il codice sorgente

debug limit snapshots

andre 2 anni fa
parent
commit
f65acda950
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      app/Services/Cloud/ResourceGuard.php

+ 6 - 1
app/Services/Cloud/ResourceGuard.php

@@ -116,10 +116,15 @@ class ResourceGuard
         //Files limit
         $maxFiles = $this->getWhmcsConfigOption(ConfigurableOption::SNAPSHOTS, $this->configuration()->getSnapshotMaxFiles());
 
+        $testRepository = new SnapshotRepository();
+        $testRepository->setApi($this->api());
+        $testRepository->findByVm(sl('Vm')->getVm());
+        $testRepository->ignoreCurrent(true);
+
         logModuleCall(
             'ProxmoxCloudVps',
             __FUNCTION__,
-            $maxFiles,
+            $testRepository->count(),
             'Debug',
             $snapshotRepository->count()
         );