]> _ Git - fluidbook-toolbox.git/commitdiff
try #6060 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 19 Jun 2023 16:19:53 +0000 (18:19 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 19 Jun 2023 16:19:53 +0000 (18:19 +0200)
app/Fluidbook/Compiler/Compiler.php
app/Fluidbook/Farm.php

index a95040a1962dac289adf89f09604d992494285b5..53b29a4768db3ff203da3a6e7d1b771ba15c39f6 100644 (file)
@@ -1915,6 +1915,7 @@ class Compiler extends Base implements CompilerInterface
 
     protected function writeImages()
     {
+        set_time_limit(0);
         switch ($this->fluidbookSettings->mobileVersion) {
             case 'html5-desktop':
                 $this->backgroundsPrefix = array(true, false);
index e2f500294814aa82b61eb096fac7b0eedff6c37e..f7c9fd67febda93bbb563350ad3a9dee7f04c30b 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace App\Fluidbook;
 
+use App\Notifications\ToolboxNotification;
 use Cubist\Util\Files\Files;
 use hollodotme\FastCGI\Client;
 use hollodotme\FastCGI\Requests\PostRequest;
@@ -78,13 +79,13 @@ class Farm
 
     }
 
-    public static function getFCGIConnexion(array $farm, $timeout = 240): NetworkSocket
+    public static function getFCGIConnexion(array $farm, $timeout = 600): NetworkSocket
     {
         $timeout *= 1000;
         return new NetworkSocket($farm['host'], $farm['port'] ?? 9457, $timeout, $timeout);
     }
 
-    public static function sendRequest($farmer, $url, $params = [], $timeout = 240)
+    public static function sendRequest($farmer, $url, $params = [], $timeout = 600)
     {
         set_time_limit(0);
         $client = new Client();
@@ -155,7 +156,10 @@ class Farm
             $output = self::sendRequest($farmer, 'process.php', $params);
         } catch (\Exception $e) {
             Log::error('Farm server error ' . $farmer['name'] . ' : ' . json_encode($params) . ' : ' . $e->getMessage());
-            exit;
+            if ($attempts > 0) {
+                return static::_getFile($params, $attempts - 1);
+            }
+            return false;
         }
 
         $output = trim($output);