From ebd583d2d812b2d3f39f11b3b9749cc30f511571 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 27 Aug 2025 17:31:22 +0200 Subject: [PATCH] #7704 --- app/Fluidbook/Compiler/Compiler.php | 4 +++- app/Fluidbook/Compiler/Links.php | 5 +++++ app/Fluidbook/Farm.php | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index bbe62a6cc..220e9509e 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -535,7 +535,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError $this->config = new Data(array_merge($this->fluidbookSettings->getRawData()['settings'], $this->themeSettings->getRawData())); - $this->config->pages = count($this->getFluidbook()->composition); + $this->config->pages = count($this->getFluidbook()->getComposition()); $this->config->bookmarkDisablePages = ArrayUtil::parseRange($this->config->bookmarkDisablePages); $this->config->rasterizePages = ArrayUtil::parseRange($this->config->rasterizePages); $this->config->vectorPages = array_diff(ArrayUtil::parseRange($this->config->vectorPages), $this->config->rasterizePages); @@ -737,6 +737,8 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError { $this->lock = \Illuminate\Support\Facades\Cache::lock('fluidbook_compile_' . $this->book_id, 1800); + $this->log('Check lock'); + if ($this->lock->block(300)) { try { if (!$this->compositionCached()) { diff --git a/app/Fluidbook/Compiler/Links.php b/app/Fluidbook/Compiler/Links.php index 4677f1c5c..7ba1315d3 100644 --- a/app/Fluidbook/Compiler/Links.php +++ b/app/Fluidbook/Compiler/Links.php @@ -93,6 +93,7 @@ trait Links } $this->writeTabs(); + $this->log('Tabs written'); $pagesOfCustomLinks = []; $hiddenLinks = []; @@ -254,6 +255,8 @@ trait Links } } + $this->log('Handle links copies'); + if ($this->fluidbookSettings->anchorsAliases && file_exists($this->fluidbookSettings->anchorsAliases)) { $aliases = []; @@ -395,6 +398,8 @@ trait Links if ($link->keep()) { $this->hiddenContents[] = $link->getHTMLContainer(); } + + $this->log('Link ' . $linkData['uid'] . ' added (page ' . $linkData['page'] . ')'); } diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index bdb9c0656..265f93f57 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -22,7 +22,7 @@ class Farm protected static $_farmServers = [ ['name' => 'amadeus', 'host' => 'amadeus.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE, 'local' => false], - ['name' => 'benhur', 'host' => 'amadeus.cubedesigners.com', 'weight' => 8, 'region' => Region::EUROPE, 'local' => false], + ['name' => 'benhur', 'host' => 'benhur.cubedesigners.com', 'weight' => 8, 'region' => Region::EUROPE, 'local' => false], ['name' => 'cloudatlas', 'host' => 'cloudatlas.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false], ['name' => 'dobermann', 'host' => 'dobermann.cubedesigners.com', 'weight' => 6, 'region' => Region::EUROPE, 'local' => false], ['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false], @@ -310,6 +310,9 @@ class Farm protected static function _getFile($params, $attempts = 3, $checkOutput = true, $preferLocal = false) { $start = microtime(true); +// if ($params['operation'] === 'extractpdfarea') { +// static::$_forceServer = 'amadeus'; +// } $farmer = self::pickOneServer($preferLocal, $params); $params['toolbox'] = '1'; @@ -429,14 +432,14 @@ class Farm } $lock = 'pdfarea_' . hash('sha256', $file . '_' . $page . '_' . json_encode($rect) . '_' . json_encode($options)); - $res = static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache) { + $res = static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache, $final) { return self::_getFile( ['operation' => 'extractpdfarea', 'pdf' => $file, 'out' => $cache, 'page' => $page, 'area' => json_encode($rect), - 'options' => json_encode($options)], 0, true, true); + 'options' => json_encode($options)], 0, $final, true); }); return $res; } -- 2.39.5