]> _ Git - fluidbook-toolbox.git/commitdiff
#7704
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Aug 2025 15:31:22 +0000 (17:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Aug 2025 15:31:22 +0000 (17:31 +0200)
app/Fluidbook/Compiler/Compiler.php
app/Fluidbook/Compiler/Links.php
app/Fluidbook/Farm.php

index bbe62a6cc3ee759d4bf70d16125e48ce142225ec..220e9509e26bb16ea7d84b290ee691aa7d744fc1 100644 (file)
@@ -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()) {
index 4677f1c5c4fbf9fe880a02158cdc559546408ee4..7ba1315d369795dc5aad0e8765a63ab0bce5396d 100644 (file)
@@ -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'] . ')');
         }
 
 
index bdb9c06565b4891db51b7568c8987835db9f420e..265f93f57dc722f7bd5aa2e5bc263652ff858d71 100644 (file)
@@ -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;
     }