Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ExpireGroupVersions.php « BackgroundJob « lib - github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8809e28d89bf422f832c667ea8a5139a01552f65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

declare(strict_types=1);
/**
 * SPDX-FileCopyrightText: 2018 Robin Appelman <robin@icewind.nl>
 * SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 *
 */

namespace OCA\GroupFolders\BackgroundJob;

use OCA\GroupFolders\Versions\GroupVersionsExpireManager;
use OCP\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;

class ExpireGroupVersions extends TimedJob {
	private GroupVersionsExpireManager $expireManager;

	public function __construct(GroupVersionsExpireManager $expireManager, ITimeFactory $timeFactory) {
		parent::__construct($timeFactory);
		// Run once per hour
		$this->setInterval(60 * 60);

		$this->expireManager = $expireManager;
	}

	protected function run($argument) {
		$this->expireManager->expireAll();
	}
}