]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6149 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 07:22:50 +0000 (09:22 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 07:22:50 +0000 (09:22 +0200)
app/Fluidbook/Farm.php
bin/startup.sh

index f7c9fd67febda93bbb563350ad3a9dee7f04c30b..de638b3183c4e200976ce76ee5caf4711912e7bf 100644 (file)
@@ -18,7 +18,7 @@ class Farm
         ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 24, 'region' => 'UE'],
         ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 2, 'region' => 'US'],
         ['name' => 'clockwork', 'host' => 'clockwork.cubedesigners.com', 'weight' => 2, 'region' => 'UE'],
-        ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 3, 'region' => 'UE'],
+        ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 6, 'region' => 'UE'],
         ['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 1, 'region' => 'UE'],
         ['name' => 'fastandfurious', 'host' => 'fastandfurious.cubedesigners.com', 'weight' => 1, 'region' => 'UE'],
         ['name' => 'godzilla', 'host' => 'godzilla.cubedesigners.com', 'weight' => 3, 'region' => 'UE'],
@@ -110,7 +110,6 @@ class Farm
         return self::_getFile($params);
     }
 
-
     public static function getFileFromPDF($pdf, $page, $format, $resolution, $quality, $withText = true, $withGraphics = true, $version = 'html', $out = null, $force = false)
     {
         if (null === $out) {
@@ -147,6 +146,9 @@ class Farm
         return $res;
     }
 
+    /**
+     * @throws \Exception
+     */
     protected static function _getFile($params, $attempts = 3)
     {
         $start = microtime(true);
@@ -175,8 +177,12 @@ class Farm
 
         error_log($log);
 
-        if (!$res && $attempts > 0) {
-            return static::_getFile($params, $attempts - 1);
+        if (!$res) {
+            if ($attempts > 0) {
+                Log::warning('Farm failure : ' . $log);
+                return static::_getFile($params, $attempts - 1);
+            }
+            throw new \Exception('Farm failure : ' . $log);
         }
 
         return $res;
index 41f0f0f5bff3680a657eb8a0d9f1a2967ed3a59f..cabdebc0fdb2df9a58da67930306244190ac6818 100644 (file)
@@ -45,6 +45,13 @@ else
     sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o uid=1002 -o gid=33 -o allow_other fluidbook@clockwork.cubedesigners.com:/data/fluidbook/hosting /mnt/hosting
 fi
 
+mkdir -p /application/protected/fluidbookpublication/docs
+if mountpoint -q "/application/protected/fluidbookpublication/docs"; then
+    :
+else
+    sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o uid=1002 -o gid=33 -o allow_other root@godzilla.cubedesigners.com:/data/fluidbook/docs /application/protected/fluidbookpublication/docs
+fi
+
 # Launch PHP
 /usr/sbin/php-fpm8.2 -O