]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6671 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Jan 2024 10:52:55 +0000 (11:52 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Jan 2024 10:52:55 +0000 (11:52 +0100)
app/Fluidbook/Compiler/Compiler.php

index df2e23567ed21251dd3fa407ff823fd9770e7483..5c2be404e2fafdea04aa446941e4dbcb8e0c6fe0 100644 (file)
@@ -36,6 +36,7 @@ use Fluidbook\Tools\Compiler\CompilerInterface;
 use Fluidbook\Tools\SVG\SVGTools;
 use Illuminate\Cache\Lock;
 use Illuminate\Console\Command;
+use Illuminate\Support\Facades\Log;
 use SplFileInfo;
 
 class Compiler extends Base implements CompilerInterface, IVirtualDirectoryErrorListener
@@ -711,7 +712,8 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
     public function handle()
     {
         $this->lock = \Illuminate\Support\Facades\Cache::lock('fluidbook_compile_' . $this->book_id, 1800);
-        if ($this->lock->get()) {
+
+        if ($this->lock->block(1800)) {
             try {
                 if (!$this->compositionCached()) {
                     $this->log('Preprocess images');
@@ -790,6 +792,8 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
                 $this->lock?->release();
             }
 
+        } else {
+            Log::debug('Failed to get lock for fluidbook #' . $this->book_id . ' compilation');
         }
     }