From: Vincent Vanwaelscappel Date: Tue, 7 Dec 2021 18:27:17 +0000 (+0100) Subject: wip #4947 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=509ad510498f6d0654989a9e27b7e90d6cdc665c;p=fluidbook_tools.git wip #4947 @0.5 --- diff --git a/src/Jobs/ProcessPage.php b/src/Jobs/ProcessPage.php index 2c3ea35..3ab575a 100644 --- a/src/Jobs/ProcessPage.php +++ b/src/Jobs/ProcessPage.php @@ -102,7 +102,21 @@ class ProcessPage implements ShouldQueue public function splitDoc() { + + + $lock = $this->getPDFInput() . '.lock'; + $returnAfterSleep = false; + + while (file_exists($lock)) { + $returnAfterSleep; + sleep(5); + } + if ($returnAfterSleep) { + return; + } + start_measure('Split PDF'); + touch($lock); Files::mkdir($this->getOut() . '/pdf'); $pdftk = new CommandLine('pdftk'); @@ -128,6 +142,7 @@ class ProcessPage implements ShouldQueue } } } + unlink($lock); stop_measure('Split PDF'); }