Sfoglia il codice sorgente

try to check ressources on changepackage

andre 4 anni fa
parent
commit
94170497b3
1 ha cambiato i file con 10 aggiunte e 11 eliminazioni
  1. 10 11
      app/Http/Actions/ChangePackage.php

+ 10 - 11
app/Http/Actions/ChangePackage.php

@@ -40,7 +40,6 @@ class ChangePackage extends AddonController
     use ProductService;
     use ProductService;
     use WhmcsParams;
     use WhmcsParams;
     use HostingService;
     use HostingService;
-    use ResourceManager;
 
 
     /**
     /**
      * @param null $params
      * @param null $params
@@ -49,22 +48,22 @@ class ChangePackage extends AddonController
      */
      */
     public function execute($params = null)
     public function execute($params = null)
     {
     {
-
-        $ressource = new ResourceManager();
-        logModuleCall(
-            'proxmoxCloud',
-            __FUNCTION__,
-            $ressource->vcpus(),
-            'Debug',
-            $ressource->memory()
-        );
-
         try {
         try {
             if(!ProxmoxAddonValidator::isInstalled()){
             if(!ProxmoxAddonValidator::isInstalled()){
                 return ProxmoxAddonValidator::failAsString();
                 return ProxmoxAddonValidator::failAsString();
             }
             }
             (new AppParams())->initFromWhmcsParams();
             (new AppParams())->initFromWhmcsParams();
             $this->networkService = new NetworkService();
             $this->networkService = new NetworkService();
+
+            $this->ressource = new ResourceManager();
+            logModuleCall(
+                'proxmoxCloud',
+                __FUNCTION__,
+                $this->ressource->vcpus(),
+                'Debug',
+                $this->ressource->memory()
+            );
+
             //Bandwith limit
             //Bandwith limit
             $this->saveUsageLimit();
             $this->saveUsageLimit();
             //Assing ip
             //Assing ip