summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-06-24 11:22:21 +0200
committerJoas Schilling <coding@schilljs.com>2021-06-24 11:22:21 +0200
commit56790b4b184be1e4764bdd0da06e8d8798f26447 (patch)
treea0c81fdfe40a642461c90783a37cc801ca4f9c5e
parenta2001262e6c334c6c147effd1cb701cc6edaf4a2 (diff)
Don't spam the log when matterbridge is disabled
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/BackgroundJob/CheckMatterbridges.php6
-rw-r--r--lib/MatterbridgeManager.php6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/BackgroundJob/CheckMatterbridges.php b/lib/BackgroundJob/CheckMatterbridges.php
index 34eca71a0..4b256f064 100644
--- a/lib/BackgroundJob/CheckMatterbridges.php
+++ b/lib/BackgroundJob/CheckMatterbridges.php
@@ -63,9 +63,11 @@ class CheckMatterbridges extends TimedJob {
if ($this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1') {
$this->bridgeManager->checkAllBridges();
$this->bridgeManager->killZombieBridges();
+ $this->logger->info('Checked if Matterbridge instances are running correctly.');
} else {
- $this->bridgeManager->stopAllBridges();
+ if ($this->bridgeManager->stopAllBridges()) {
+ $this->logger->info('Stopped all Matterbridge instances as it is disabled');
+ }
}
- $this->logger->info('Checked if Matterbridge instances are running correctly.');
}
}
diff --git a/lib/MatterbridgeManager.php b/lib/MatterbridgeManager.php
index 34c437f51..4afd4eda6 100644
--- a/lib/MatterbridgeManager.php
+++ b/lib/MatterbridgeManager.php
@@ -843,7 +843,7 @@ class MatterbridgeManager {
/**
* Stop all bridges
*
- * @return bool success
+ * @return bool If bridges where stopped
*/
public function stopAllBridges(): bool {
$query = $this->db->getQueryBuilder();
@@ -851,11 +851,11 @@ class MatterbridgeManager {
$query->update('talk_bridges')
->set('enabled', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->set('pid', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT));
- $query->execute();
+ $result = $query->executeStatement();
// finally kill all potential zombie matterbridge processes
$this->killZombieBridges(true);
- return true;
+ return $result !== 0;
}
/**