aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/PreviewManager.php
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-05-21 21:55:09 +0200
committerDaniel <mail@danielkesselberg.de>2023-07-21 17:21:55 +0200
commit30f8c07c6e2a05d0c5f1c40f1e93d805a2cd434f (patch)
tree290e3c46ee142d319d7834df4601bef55f1b0033 /lib/private/PreviewManager.php
parentd0957ffd977839367b376fae55b48ae34440350e (diff)
downloadnextcloud-server-fix-remove-auto-guessing-for-preview-semaphore.tar.gz
nextcloud-server-fix-remove-auto-guessing-for-preview-semaphore.zip
fix: remove cpu core detection for preview semaphorefix-remove-auto-guessing-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 <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private/PreviewManager.php')
-rw-r--r--lib/private/PreviewManager.php2
1 files changed, 1 insertions, 1 deletions
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);