From 9f8c82774e8324f4b86dbbc43f54c0e04c74a425 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Apr 2022 16:41:02 +0200 Subject: [PATCH] Fix background job Signed-off-by: Joas Schilling --- lib/BackgroundJobs/MonthlyReport.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/BackgroundJobs/MonthlyReport.php b/lib/BackgroundJobs/MonthlyReport.php index d634e6e2..7f8620ad 100644 --- a/lib/BackgroundJobs/MonthlyReport.php +++ b/lib/BackgroundJobs/MonthlyReport.php @@ -21,17 +21,15 @@ namespace OCA\Survey_Client\BackgroundJobs; -use OC\BackgroundJob\TimedJob; use OCA\Survey_Client\AppInfo\Application; use OCP\AppFramework\Http; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJob; +use OCP\BackgroundJob\TimedJob; class MonthlyReport extends TimedJob { - - /** - * MonthlyReport constructor. - */ - public function __construct() { + public function __construct(ITimeFactory $time) { + parent::__construct($time); // Run all 28 days $this->setInterval(28 * 24 * 60 * 60); // keeping time sensitive to not overload the target server at a single specific time of the day