diff --git a/app/realtime.php b/app/realtime.php index 28e6c1691f..9c3c2b4d6a 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -380,8 +380,10 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $user = $database->getDocument('users', $userId); $roles = Auth::getRoles($user); + $channels = $realtime->connections[$connection]['channels']; - $realtime->subscribe($projectId, $connection, $roles, $realtime->connections[$connection]['channels']); + $realtime->unsubscribe($connection); + $realtime->subscribe($projectId, $connection, $roles, $channels); $register->get('pools')->reclaim(); }