Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IAppConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\SetupCheck\ISetupCheck;
use OCP\SetupCheck\SetupResult;
use OCP\TaskProcessing\IManager;
Expand All @@ -26,6 +27,7 @@ public function __construct(
private readonly IManager $taskProcessingManager,
private readonly ITimeFactory $timeFactory,
private readonly IAppConfig $appConfig,
private readonly IURLGenerator $url,
) {
}

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

if ($lastIteration > 0) {
return SetupResult::warning(
$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)])
$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)]),
linkToDoc: $this->url->linkToDocs('admin-ai-pickup-speed'),
);
}

return SetupResult::warning(
$this->l10n->t('The Task Processing worker does not seem to be running. It seems it has never run so far.')
$this->l10n->t('The Task Processing worker does not seem to be running. It seems it has never run so far.'),
linkToDoc: $this->url->linkToDocs('admin-ai-pickup-speed'),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IAppConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\SetupCheck\SetupResult;
use OCP\TaskProcessing\IManager;
use OCP\TaskProcessing\Task;
Expand All @@ -23,6 +24,7 @@ class TaskProcessingWorkerIsRunningTest extends TestCase {
private ITimeFactory&MockObject $timeFactory;
private IManager&MockObject $taskProcessingManager;
private IAppConfig&MockObject $appConfig;
private IURLGenerator&MockObject $urlGenerator;

private TaskProcessingWorkerIsRunning $check;

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

$this->check = new TaskProcessingWorkerIsRunning(
$this->l10n,
$this->taskProcessingManager,
$this->timeFactory,
$this->appConfig
$this->appConfig,
$this->urlGenerator,
);
}

Expand Down
Loading