Skip to content

Commit

Permalink
fix(job): Call parent constructor and use the time factory
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Feb 12, 2024
1 parent bf8b503 commit 910688f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Notification/BackgroundJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class BackgroundJob extends QueuedJob {
public function __construct(
protected INotificationManager $notificationManager,
) {
parent::__construct();
}

/**
Expand All @@ -45,7 +46,7 @@ protected function run($argument) {
->setUser($argument['uid']);

if ($this->notificationManager->getCount($notification) === 0) {
$notification->setDateTime(new \DateTime());
$notification->setDateTime($this->time->getDateTime());
$this->notificationManager->notify($notification);
}
}
Expand Down

0 comments on commit 910688f

Please sign in to comment.