Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
SigningCoordinatorService
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 shouldUseParallelProcessing
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Service;
10
11use OCA\Libresign\AppInfo\Application;
12use OCP\IAppConfig;
13
14class SigningCoordinatorService {
15    public function __construct(
16        private IAppConfig $appConfig,
17    ) {
18    }
19
20    public function shouldUseParallelProcessing(int $signRequestCount): bool {
21        if ($signRequestCount <= 1) {
22            return false;
23        }
24
25        $signingMode = $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'sync');
26        return $signingMode === 'async';
27    }
28}