Skip to content

Commit a1036fe

Browse files
committed
fix: Make sure getNumConcurrentPreviews never returns 0
Tests were stuck forever waiting for a semaphore because concurrency was returning 0. It was previously working by chance because cache of the value in a static var was leaking through tests. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent ab6109b commit a1036fe

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/private/Preview/Generator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ public function getNumConcurrentPreviews(string $type): int {
306306
default:
307307
return -1;
308308
}
309+
if ($this->cachedNumConcurrentPreviews[$type] < 1) {
310+
$this->cachedNumConcurrentPreviews[$type] = 1;
311+
}
309312
return $this->cachedNumConcurrentPreviews[$type];
310313
}
311314

0 commit comments

Comments
 (0)