Browse Source

UPD: Engine

Giancarlo Voci 7 years ago
parent
commit
4bd79bbcde
2 changed files with 5 additions and 2 deletions
  1. 4 1
      src/OpenMind/FindBox/FindBoxCoreSystem.php
  2. 1 1
      src/OpenMind/System/System.php

+ 4 - 1
src/OpenMind/FindBox/FindBoxCoreSystem.php

@@ -71,7 +71,7 @@ class FindBoxCoreSystem
    */
   public function CallAPI(string $URI, string $Parameters, bool $skipResponse = false): array
   {
-    $bodyJSON = "{}";
+    $bodyJSON = null;
     $auth = "Authorization: Basic " . base64_encode("{$this->Key}:{$this->Pass}") . "\r\n";
 
     $streamfbOS = @stream_socket_client("tcp://{$this->Host}:{$this->Port}", $errno, $errstr, 1);
@@ -89,6 +89,9 @@ class FindBoxCoreSystem
       }
       fclose($streamfbOS);
     }
+
+    $bodyJSON = ($bodyJSON == null) ? "{}" : $bodyJSON;
+
     return $this->returnCode(0, $bodyJSON);
   }
 

+ 1 - 1
src/OpenMind/System/System.php

@@ -95,7 +95,7 @@ class System extends PluginStrategy
     $qs = new QueueSystem('FindBoxService_isAlive');
     if (!$qs->check()) {
       $lastUpdate = time() - $qs->command;
-      if ($lastUpdate > ($f3->get('FINDBOXSERVICE.SLEEPTIME') / 1000) + 2) { // 2 secondi come piccolo delay
+      if ($lastUpdate > ($f3->get('FINDBOXSERVICE.SLEEPTIME') / 1000) * 2) { // attende il doppio del tempo
         $omlNotifications = new Notifications();
         $omlNotifications->notify(Notifications::FB_NOTALIVE, 'Errore: Servizio di FindBox non disponibile');
       } else {