mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-25 16:04:19 +08:00
fix deprecations in ExpireCredentials background job
This commit is contained in:
parent
b83bb2dc5e
commit
9bba4df657
1 changed files with 12 additions and 12 deletions
|
@ -23,8 +23,9 @@
|
|||
|
||||
namespace OCA\Passman\BackgroundJob;
|
||||
|
||||
use OC\BackgroundJob\TimedJob;
|
||||
use OCA\Passman\Service\CronService;
|
||||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\BackgroundJob\TimedJob;
|
||||
use OCP\IConfig;
|
||||
|
||||
/**
|
||||
|
@ -34,22 +35,21 @@ use OCP\IConfig;
|
|||
*/
|
||||
class ExpireCredentials extends TimedJob {
|
||||
|
||||
protected IConfig $config;
|
||||
private CronService $cronService;
|
||||
/**
|
||||
* ExpireCredentials constructor.
|
||||
*
|
||||
* @param ITimeFactory $timeFactory
|
||||
* @param IConfig $config
|
||||
* @param CronService $cronService
|
||||
*/
|
||||
public function __construct(ITimeFactory $timeFactory, protected IConfig $config, private CronService $cronService) {
|
||||
parent::__construct($timeFactory);
|
||||
|
||||
/**
|
||||
* ExpireCredentials constructor.
|
||||
* @param IConfig $config
|
||||
* @param CronService $cronService
|
||||
*/
|
||||
public function __construct(IConfig $config, CronService $cronService) {
|
||||
// Run once per minute
|
||||
$this->setInterval(60);
|
||||
$this->config = $config;
|
||||
$this->cronService = $cronService;
|
||||
}
|
||||
|
||||
protected function run($argument) {
|
||||
protected function run($argument): void {
|
||||
$this->cronService->expireCredentials();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue