From bbb0f31fdbde73c0edb48c861896a4b107efb0c3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 20 Jul 2023 09:22:50 +0200 Subject: [PATCH] wait #6149 @0.5 --- app/Fluidbook/Farm.php | 14 ++++++++++---- bin/startup.sh | 7 +++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index f7c9fd67f..de638b318 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -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; diff --git a/bin/startup.sh b/bin/startup.sh index 41f0f0f5b..cabdebc0f 100644 --- a/bin/startup.sh +++ b/bin/startup.sh @@ -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 -- 2.39.5