From 027b183015871bb3a9bc3220235b9d0c2d6a7a67 Mon Sep 17 00:00:00 2001 From: Pavel Smalenski Date: Wed, 23 Jun 2021 12:38:39 +0200 Subject: [PATCH] Prevent unwanted timeout function call --- selenoid.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selenoid.go b/selenoid.go index 5016bb53..bff21939 100644 --- a/selenoid.go +++ b/selenoid.go @@ -529,6 +529,11 @@ func reverseProxy(hostFn func(sess *session.Session) string, status string) func sid, remainingPath := splitRequestPath(r.URL.Path) sess, ok := sessions.Get(sid) if ok { + select { + case <-sess.TimeoutCh: + default: + close(sess.TimeoutCh) + } sess.TimeoutCh = onTimeout(sess.Timeout, func() { request{r}.session(sid).Delete(requestId) })