Explorar o código

bugfix UsageUpdate

andre %!s(int64=2) %!d(string=hai) anos
pai
achega
d71f7cd7eb
Modificáronse 1 ficheiros con 9 adicións e 10 borrados
  1. 9 10
      app/Http/Actions/UsageUpdate.php

+ 9 - 10
app/Http/Actions/UsageUpdate.php

@@ -14,7 +14,15 @@ class UsageUpdate extends AddonController
     public function execute($params = null)
     {
         $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
-        
+
+        logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $params,
+            'Debug Usage',
+            $api
+        );
+
         try {
             $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
             $domains = $api->getDomains(['id','name']);
@@ -68,15 +76,6 @@ class UsageUpdate extends AddonController
 
                 Whmcs\Hosting::where('server', $serverId)->where('domain', $domainName)->update(['bwusage' => $mailboxes]);
                 Whmcs\Hosting::where('server', $serverId)->where('domain', $domainName)->update(['diskusage' => $storage]);
-
-                logModuleCall(
-                    'kerioEmail',
-                    __FUNCTION__,
-                    $storage,
-                    'Debug Usage',
-                    $mailboxes
-                );
-
                 usleep(5000);
             }
             catch (\Exception $ex)