From 30f8c07c6e2a05d0c5f1c40f1e93d805a2cd434f Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 21 May 2023 21:55:09 +0200 Subject: fix: remove cpu core detection for preview semaphore The idea of automatically limiting the number of concurrent preview requests to the number of CPU cores is nice. Unfortunately it's difficult to determinate the number of CPU cores (e.g. open_basedir, freebsd, etc.). This patch removes the detection and set the default for requests (existing + new) to 8 and generation to 4. Signed-off-by: Daniel Kesselberg --- lib/private/PreviewManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/PreviewManager.php') diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 814235f4212..647acd9376e 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -186,7 +186,7 @@ class PreviewManager implements IPreview { * @since 11.0.0 - \InvalidArgumentException was added in 12.0.0 */ public function getPreview(File $file, $width = -1, $height = -1, $crop = false, $mode = IPreview::MODE_FILL, $mimeType = null) { - $previewConcurrency = $this->getGenerator()->getNumConcurrentPreviews('preview_concurrency_all'); + $previewConcurrency = $this->config->getSystemValueInt('preview_concurrency_all', 8); $sem = Generator::guardWithSemaphore(Generator::SEMAPHORE_ID_ALL, $previewConcurrency); try { $preview = $this->getGenerator()->getPreview($file, $width, $height, $crop, $mode, $mimeType); -- cgit v1.2.3