From: Vincent Vanwaelscappel Date: Thu, 25 Jan 2024 10:52:55 +0000 (+0100) Subject: wip #6671 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fd8c6151ec2949f42f09a4a0d7cee61ce840eb74;p=fluidbook-toolbox.git wip #6671 @0.25 --- diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index df2e23567..5c2be404e 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -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'); } }