setInterval(1); } #[\Override] protected function run($argument): void { $maxCallDuration = $this->appConfig->getAppValueInt('max_call_duration'); if ($maxCallDuration <= 0) { return; } $now = $this->time->getDateTime(); $maxActiveSince = $now->sub(new \DateInterval('PT' . $maxCallDuration . 'S')); $rooms = $this->manager->getRoomsLongerActiveSince($maxActiveSince); foreach ($rooms as $room) { if ($room->isFederatedConversation()) { continue; } $result = $this->roomService->resetActiveSinceInDatabaseOnly($room); if (!$result) { // Someone else won the race condition, make sure this user disconnects directly and then return continue; } $this->participantService->endCallForEveryone($room, null); $this->roomService->resetActiveSinceInModelOnly($room); } } }