зеркало из https://github.com/nextcloud/spreed.git
Don't loop over the rooms when we kill all anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
ce87e93999
Коммит
c01ff3fa24
|
@ -654,8 +654,9 @@ class MatterbridgeManager {
|
|||
|
||||
/**
|
||||
* kill the mattermost processes (owned by web server unix user) that do not match with any room
|
||||
* @param bool $killAll
|
||||
*/
|
||||
public function killZombieBridges(): void {
|
||||
public function killZombieBridges(bool $killAll = false): void {
|
||||
// get list of running matterbridge processes
|
||||
$cmd = 'ps -ux | grep "commands/matterbridge" | grep -v grep | awk \'{print $2}\'';
|
||||
exec($cmd, $output, $ret);
|
||||
|
@ -669,6 +670,13 @@ class MatterbridgeManager {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($killAll) {
|
||||
foreach ($runningPidList as $runningPid) {
|
||||
$this->killPid($runningPid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// get list of what should be running
|
||||
$expectedPidList = [];
|
||||
$this->manager->forAllRooms(function ($room) use (&$expectedPidList) {
|
||||
|
@ -734,7 +742,7 @@ class MatterbridgeManager {
|
|||
});
|
||||
|
||||
// finally kill all potential zombie matterbridge processes
|
||||
$this->killZombieBridges();
|
||||
$this->killZombieBridges(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче