From deb2d346d8f6da6f7b8bf7431ceeff5d81d1927c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 22 May 2019 15:53:47 +0200 Subject: Session cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/SessionService.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/Service/SessionService.php') diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php index c46a1fef4..a23447914 100644 --- a/lib/Service/SessionService.php +++ b/lib/Service/SessionService.php @@ -64,13 +64,12 @@ class SessionService { return $this->sessionMapper->insert($session); } - /** - * @throws DoesNotExistException - */ - public function closeSession($documentId, $sessionId, $token): void { - $session = $this->sessionMapper->find($documentId, $sessionId, $token); - // TODO: check for unpersisited changes from session? - $this->sessionMapper->delete($session); + public function closeSession(int $documentId, int $sessionId, string $token): void { + try { + $session = $this->sessionMapper->find($documentId, $sessionId, $token); + $this->sessionMapper->delete($session); + } catch (DoesNotExistException $e) { + } } public function getActiveSessions($documentId): array { -- cgit v1.2.3