AddCleanupUpdaterBackupsJob.php 711 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Repair;
  7. use OC\Core\BackgroundJobs\BackgroundCleanupUpdaterBackupsJob;
  8. use OCP\BackgroundJob\IJobList;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\IRepairStep;
  11. class AddCleanupUpdaterBackupsJob implements IRepairStep {
  12. /** @var IJobList */
  13. protected $jobList;
  14. public function __construct(IJobList $jobList) {
  15. $this->jobList = $jobList;
  16. }
  17. public function getName() {
  18. return 'Queue a one-time job to cleanup old backups of the updater';
  19. }
  20. public function run(IOutput $output) {
  21. $this->jobList->add(BackgroundCleanupUpdaterBackupsJob::class);
  22. }
  23. }