File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 11<?php
2+
3+ declare (strict_types=1 );
24/**
35 * @copyright Copyright (c) 2016, ownCloud, Inc.
46 *
2224
2325namespace OCA \Activity \BackgroundJob ;
2426
25- use OC \BackgroundJob \TimedJob ;
2627use OCA \Activity \Data ;
28+ use OCP \AppFramework \Utility \ITimeFactory ;
29+ use OCP \BackgroundJob \TimedJob ;
2730use OCP \IConfig ;
2831
29- /**
30- * Class ExpireActivities
31- *
32- * @package OCA\Activity\BackgroundJob
33- */
3432class ExpireActivities extends TimedJob {
3533 /** @var Data */
3634 protected $ data ;
3735 /** @var IConfig */
3836 protected $ config ;
3937
40- /**
41- * @param Data $data
42- * @param IConfig $config
43- */
44- public function __construct ( Data $ data , IConfig $ config ) {
38+ public function __construct ( ITimeFactory $ time ,
39+ Data $ data,
40+ IConfig $ config) {
41+ parent :: __construct ( $ time );
42+
4543 // Run once per day
4644 $ this ->setInterval (60 * 60 * 24 );
45+ $ this ->setTimeSensitivity (self ::TIME_INSENSITIVE );
4746
4847 $ this ->data = $ data ;
4948 $ this ->config = $ config ;
5049 }
5150
52- protected function run ($ argument ) {
51+ protected function run ($ argument ): void {
5352 // Remove activities that are older then one year
5453 $ expireDays = $ this ->config ->getSystemValue ('activity_expire_days ' , 365 );
5554 $ this ->data ->expire ($ expireDays );
You can’t perform that action at this time.
0 commit comments