2023-06-28 12:59:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
2024-05-23 07:26:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-06-28 12:59:20 +00:00
|
|
|
*/
|
|
|
|
namespace OC\Repair;
|
|
|
|
|
2024-04-30 15:01:41 +00:00
|
|
|
use OC\TaskProcessing\RemoveOldTasksBackgroundJob;
|
2023-09-07 10:37:09 +00:00
|
|
|
use OC\TextProcessing\RemoveOldTasksBackgroundJob as RemoveOldTextProcessingTasksBackgroundJob;
|
|
|
|
use OC\TextToImage\RemoveOldTasksBackgroundJob as RemoveOldTextToImageTasksBackgroundJob;
|
2023-06-28 12:59:20 +00:00
|
|
|
use OCP\BackgroundJob\IJobList;
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
use OCP\Migration\IRepairStep;
|
|
|
|
|
|
|
|
class AddRemoveOldTasksBackgroundJob implements IRepairStep {
|
|
|
|
private IJobList $jobList;
|
|
|
|
|
|
|
|
public function __construct(IJobList $jobList) {
|
|
|
|
$this->jobList = $jobList;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(): string {
|
2024-04-30 14:37:13 +00:00
|
|
|
return 'Add AI tasks cleanup jobs';
|
2023-06-28 12:59:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function run(IOutput $output) {
|
2023-09-07 10:37:09 +00:00
|
|
|
$this->jobList->add(RemoveOldTextProcessingTasksBackgroundJob::class);
|
|
|
|
$this->jobList->add(RemoveOldTextToImageTasksBackgroundJob::class);
|
2024-04-30 14:37:13 +00:00
|
|
|
$this->jobList->add(RemoveOldTasksBackgroundJob::class);
|
2023-06-28 12:59:20 +00:00
|
|
|
}
|
|
|
|
}
|