Skip to content

Commit 8ed645d

Browse files
Merge pull request #62441 from nextcloud/backport/62240/stable32
[stable32] fix(SetupChecks): Link to task processing worker docs
2 parents cf72deb + 8077a14 commit 8ed645d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

apps/settings/lib/SetupChecks/TaskProcessingWorkerIsRunning.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCP\AppFramework\Utility\ITimeFactory;
1313
use OCP\IAppConfig;
1414
use OCP\IL10N;
15+
use OCP\IURLGenerator;
1516
use OCP\SetupCheck\ISetupCheck;
1617
use OCP\SetupCheck\SetupResult;
1718
use OCP\TaskProcessing\IManager;
@@ -26,6 +27,7 @@ public function __construct(
2627
private readonly IManager $taskProcessingManager,
2728
private readonly ITimeFactory $timeFactory,
2829
private readonly IAppConfig $appConfig,
30+
private readonly IURLGenerator $url,
2931
) {
3032
}
3133

@@ -63,12 +65,14 @@ public function run(): SetupResult {
6365

6466
if ($lastIteration > 0) {
6567
return SetupResult::warning(
66-
$this->l10n->t('The Task Processing worker does not seem to be running. The last run was at %s.', [date('Y-m-d H:i:s', $lastIteration)])
68+
$this->l10n->t('The Task Processing worker does not seem to be running. The last run was at %s.', [date('Y-m-d H:i:s', $lastIteration)]),
69+
linkToDoc: $this->url->linkToDocs('admin-ai-pickup-speed'),
6770
);
6871
}
6972

7073
return SetupResult::warning(
71-
$this->l10n->t('The Task Processing worker does not seem to be running. It seems it has never run so far.')
74+
$this->l10n->t('The Task Processing worker does not seem to be running. It seems it has never run so far.'),
75+
linkToDoc: $this->url->linkToDocs('admin-ai-pickup-speed'),
7276
);
7377
}
7478
}

apps/settings/tests/SetupChecks/TaskProcessingWorkerIsRunningTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCP\AppFramework\Utility\ITimeFactory;
1313
use OCP\IAppConfig;
1414
use OCP\IL10N;
15+
use OCP\IURLGenerator;
1516
use OCP\SetupCheck\SetupResult;
1617
use OCP\TaskProcessing\IManager;
1718
use OCP\TaskProcessing\Task;
@@ -23,6 +24,7 @@ class TaskProcessingWorkerIsRunningTest extends TestCase {
2324
private ITimeFactory&MockObject $timeFactory;
2425
private IManager&MockObject $taskProcessingManager;
2526
private IAppConfig&MockObject $appConfig;
27+
private IURLGenerator&MockObject $urlGenerator;
2628

2729
private TaskProcessingWorkerIsRunning $check;
2830

@@ -33,12 +35,14 @@ protected function setUp(): void {
3335
$this->timeFactory = $this->getMockBuilder(ITimeFactory::class)->getMock();
3436
$this->taskProcessingManager = $this->getMockBuilder(IManager::class)->getMock();
3537
$this->appConfig = $this->getMockBuilder(IAppConfig::class)->getMock();
38+
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
3639

3740
$this->check = new TaskProcessingWorkerIsRunning(
3841
$this->l10n,
3942
$this->taskProcessingManager,
4043
$this->timeFactory,
41-
$this->appConfig
44+
$this->appConfig,
45+
$this->urlGenerator,
4246
);
4347
}
4448

0 commit comments

Comments
 (0)