From: Vincent Vanwaelscappel Date: Mon, 2 Oct 2023 16:46:00 +0000 (+0200) Subject: wip #6278 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=713ce091b933a0d9cf5c410133c4b1417813d9c1;p=fluidbook-toolbox.git wip #6278 @1 --- diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index 4dd8b12e6..82cf2dd36 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -2,7 +2,6 @@ namespace App\Fluidbook; -use App\Notifications\ToolboxNotification; use Cubist\Util\Files\Files; use Fluidbook\Tools\Jobs\ProcessFile; use hollodotme\FastCGI\Client; @@ -16,8 +15,8 @@ class Farm { protected static $_outPDF = []; - protected static $_forceServer = false; - //protected static $_forceServer = 'alphaville'; + //protected static $_forceServer = false; + protected static $_forceServer = 'alphaville'; protected static $_farmServers = [ ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 24, 'region' => 'UE'], ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 2, 'region' => 'US'], @@ -159,6 +158,7 @@ class Farm }); if ((!$res || !file_exists($res)) && $attempts > 0) { + Cache::forget($cachekey); return self::getFileFromPDF($pdf, $page, $format, $resolution, $quality, $withText, $withGraphics, $version, $out, true, $attempts - 1); } @@ -194,8 +194,6 @@ class Farm $time = round(microtime(true) - $start, 4); $log = '[' . $farmer['name'] . ']' . "\t" . date('Y-m-d H:i:s') . "\t" . $time . "\t" . implode('|', $params) . "\t($res)\t>>" . $output . "\n"; - error_log($log); - if (!$res) { if ($attempts > 0) { Log::warning('Farm failure ('.$farmer['name'].') : ' . $output); diff --git a/app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php b/app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php index aef6300ae..e9da0a306 100644 --- a/app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php +++ b/app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php @@ -61,7 +61,7 @@ trait DockerWebContainer $dockerSuffix = $env === 'production' ? '' : '-' . $env; - $variables = ['$name' => $name.$dockerSuffix, + $variables = ['$name' => $name . $dockerSuffix, '$portadminer' => rand(10000, 60000), '$portmatomo' => rand(10000, 60000), '$matomodbpassword' => Str::random(16), @@ -95,6 +95,9 @@ trait DockerWebContainer if ($request->get('mysql', true)) { $compose[] = 'mysql'; } + if ($request->get('redis', true)) { + $compose[] = 'redis'; + } if ($request->get('matomo', true)) { $compose[] = 'matomo'; } @@ -128,7 +131,7 @@ trait DockerWebContainer foreach ($infos as $k => $v) { $notification .= '* ' . $k . ' : ' . $v . "\n"; } - $notification.="\n"; + $notification .= "\n"; Files::recursiveReplaceStringInDir($dir, $variables); }