Skip to content

Commit

Permalink
Merge pull request #4122 from nextcloud/fix/relaunch-bridge-on-config…
Browse files Browse the repository at this point in the history
…-edit

Kill matterbridge before editing the config file
  • Loading branch information
nickvergessen authored Sep 7, 2020
2 parents ac2d6e6 + b03981d commit 66083b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/MatterbridgeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public function getBridgeLog(Room $room): string {
*/
public function editBridgeOfRoom(Room $room, bool $enabled, array $parts = []): array {
$currentBridge = $this->getBridgeOfRoom($room);
// kill matterbridge if we edit a running bridge config file so that it will be launched again
// matterbridge dynamic config reload does not fully work
if ($currentBridge['enabled'] && $enabled && $currentBridge['pid'] && $currentBridge['pid'] !== 0) {
$this->killPid($currentBridge['pid']);
}
$newBridge = [
'enabled' => $enabled,
'pid' => isset($currentBridge['pid']) ? $currentBridge['pid'] : 0,
Expand Down

0 comments on commit 66083b9

Please sign in to comment.