Explorar o código

debug limit snapshots

andre %!s(int64=2) %!d(string=hai) anos
pai
achega
f65acda950
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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()
         );