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

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-05-29 23:52:27 +0300
committerJoas Schilling <coding@schilljs.com>2020-06-10 17:26:50 +0300
commit76add437b8a63fc32fa2dd7f38575f996e4e8967 (patch)
tree8514178ca1d95d55f999ce130eba6245d49bfecd /lib
parent2071501469c0058b255ec38d2ed5ca030efeca79 (diff)
Log an info message when the background job fetched something
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/BackgroundJob/CheckHostedSignalingServer.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/BackgroundJob/CheckHostedSignalingServer.php b/lib/BackgroundJob/CheckHostedSignalingServer.php
index 2bc80354d..472150ce5 100644
--- a/lib/BackgroundJob/CheckHostedSignalingServer.php
+++ b/lib/BackgroundJob/CheckHostedSignalingServer.php
@@ -30,6 +30,7 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCP\IConfig;
use OCP\IGroupManager;
+use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\Notification\IManager;
@@ -45,13 +46,16 @@ class CheckHostedSignalingServer extends TimedJob {
private $groupManager;
/** @var IURLGenerator */
private $urlGenerator;
+ /** @var ILogger */
+ private $logger;
public function __construct(ITimeFactory $timeFactory,
HostedSignalingServerService $hostedSignalingServerService,
IConfig $config,
IManager $notificationManager,
IGroupManager $groupManager,
- IURLGenerator $urlGenerator) {
+ IURLGenerator $urlGenerator,
+ ILogger $logger) {
parent::__construct($timeFactory);
$this->setInterval(3600);
$this->hostedSignalingServerService = $hostedSignalingServerService;
@@ -59,6 +63,7 @@ class CheckHostedSignalingServer extends TimedJob {
$this->notificationManager = $notificationManager;
$this->groupManager = $groupManager;
$this->urlGenerator = $urlGenerator;
+ $this->logger = $logger;
}
protected function run($argument): void {
@@ -146,6 +151,8 @@ class CheckHostedSignalingServer extends TimedJob {
$this->config->setAppValue('spreed', 'hosted-signaling-server-account-last-checked', $this->time->getTime());
if (!is_null($notificationSubject)) {
+ $this->logger->info('Hosted signaling server background job caused a notification: ' . $notificationSubject . ' ' . json_encode($notificationParameters), ['app' => 'spreed']);
+
$notification = $this->notificationManager->createNotification();
$notification
->setApp('spreed')