Skip to content

Commit

Permalink
kill matterbridge before config edition
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Sep 7, 2020
1 parent bf37e6c commit b03981d
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 b03981d

Please sign in to comment.