From d7804edc753f0d60a4f9719bd73d0312a2e50d95 Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Thu, 22 Feb 2018 17:59:28 -0500 Subject: [PATCH] feat(sessions): adding endAllPooledSessions helper method --- lib/sessions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/sessions.js b/lib/sessions.js index b55af7539..110add8e7 100644 --- a/lib/sessions.js +++ b/lib/sessions.js @@ -141,6 +141,13 @@ class ServerSessionPool { this.sessions = []; } + endAllPooledSessions() { + if (this.sessions.length) { + this.topology.endSessions(this.sessions.map(session => session.id)); + this.sessions = []; + } + } + /** * @returns {ServerSession} */