From: Vincent Vanwaelscappel Date: Mon, 8 Jan 2024 13:55:47 +0000 (+0100) Subject: wait #6613 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e94edd1a6d5c7f64b1359921f81bed2f1915cac6;p=fluidbook-toolbox.git wait #6613 @2 --- diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index f75424cf5..37178c9a8 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -219,19 +219,29 @@ class Farm public static function cutPDF($pdf, $mode, $out) { - return self::_getFile(['operation' => 'cutpdf', - 'pdf' => $pdf, - 'out' => $out, - 'mode' => $mode, - ], 0, false, true); + return static::lock($pdf, 'cut_' . $mode, function () use ($pdf, $mode, $out) { + if (file_exists($out) && filesize($out) > 0 && filemtime($out) >= filemtime($pdf)) { + return $out; + } + return self::_getFile(['operation' => 'cutpdf', + 'pdf' => $pdf, + 'out' => $out, + 'mode' => $mode, + ], 0, false, true); + }); } public static function trimPDF($pdf, $out) { - return self::_getFile(['operation' => 'trimpdf', - 'pdf' => $pdf, - 'out' => $out, - ], 0, false, true); + return static::lock($pdf, 'trim', function () use ($pdf, $out) { + if (file_exists($out) && filesize($out) > 0 && filemtime($out) >= filemtime($pdf)) { + return $out; + } + return self::_getFile(['operation' => 'trimpdf', + 'pdf' => $pdf, + 'out' => $out, + ], 0, false, true); + }); } public static function splitPDF($pdf, $out) @@ -243,30 +253,36 @@ class Farm public static function extractLinks($pdf, $out) { - return self::_getFile(['operation' => 'extractlinks', - 'pdf' => $pdf, - 'out' => $out], 0, false, true); + return static::lock($pdf, 'links', function () use ($pdf, $out) { + return self::_getFile(['operation' => 'extractlinks', + 'pdf' => $pdf, + 'out' => $out], 0, false, true); + }); } public static function extractTexts($pdf, $out, $mode, $extractionMethod, $ignoreSeparators) { - return self::_getFile( - ['operation' => 'extracttexts', - 'pdf' => $pdf, - 'out' => $out, - 'mode' => $mode, - 'method' => $extractionMethod, - 'ignoreseparators' => $ignoreSeparators], 0, false, true); + return static::lock($pdf, 'texts_' . $mode . '_' . $extractionMethod . '_' . md5($ignoreSeparators), function () use ($pdf, $out, $mode, $extractionMethod, $ignoreSeparators) { + return self::_getFile( + ['operation' => 'extracttexts', + 'pdf' => $pdf, + 'out' => $out, + 'mode' => $mode, + 'method' => $extractionMethod, + 'ignoreseparators' => $ignoreSeparators], 0, false, true); + }); } public static function extractHighlightsData($pdf, $out, $mode, $ignoreSeparators) { - return self::_getFile( - ['operation' => 'extracthightlightsdata', - 'pdf' => $pdf, - 'out' => $out, - 'mode' => $mode, - 'ignoreseparators' => $ignoreSeparators], 0, false, true); + return static::lock($pdf, 'texts_' . $mode . '_' . md5($ignoreSeparators), function () use ($pdf, $out, $mode, $ignoreSeparators) { + return self::_getFile( + ['operation' => 'extracthightlightsdata', + 'pdf' => $pdf, + 'out' => $out, + 'mode' => $mode, + 'ignoreseparators' => $ignoreSeparators], 0, false, true); + }); } /** diff --git a/bin/startup.sh b/bin/startup.sh index 9dddf8bfd..0cdc86c03 100644 --- a/bin/startup.sh +++ b/bin/startup.sh @@ -65,7 +65,6 @@ mkdir -p /application/protected/fluidbookpublication/docs if mountpoint -q "/application/protected/fluidbookpublication/docs"; then : else - #sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o cache=no -o sshfs_sync -o uid=1002 -o gid=33 -o allow_other root@godzilla.cubedesigners.com:/data/fluidbook/docs /application/protected/fluidbookpublication/docs sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o cache=no -o uid=1002 -o gid=33 -o allow_other root@dracula.cubedesigners.com:/data/fluidbook/docs /application/protected/fluidbookpublication/docs fi diff --git a/resources/emailconfig/spamassassin-rules.cf b/resources/emailconfig/spamassassin-rules.cf index 5f7efe5de..6c2a85240 100644 --- a/resources/emailconfig/spamassassin-rules.cf +++ b/resources/emailconfig/spamassassin-rules.cf @@ -25,6 +25,7 @@ describe X_FLUIDBOOK_SPAM Message has been marked as SPAM by Fluidbook score X_FLUIDBOOK_SPAM 110.0 score DKIM_INVALID 1 +score BITCOIN_PAY_ME 6 # TXRep loadplugin Mail::SpamAssassin::Plugin::TxRep