diff --git a/Gopkg.lock b/Gopkg.lock index 8dc93511..2c807567 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -74,6 +74,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "ecf27a574f7d4a70a40be14ee6471084c82fc617cef57199bdb72ab9528ecc5e" + inputs-digest = "9e272825174ad2baae1001d72800484e2cf91454ad7efdd214ea517034500fce" solver-name = "gps-cdcl" solver-version = 1 diff --git a/selenoid.go b/selenoid.go index 62307c1b..8cc9b479 100644 --- a/selenoid.go +++ b/selenoid.go @@ -356,7 +356,11 @@ func proxy(w http.ResponseWriter, r *http.Request) { if ok { sess.Lock.Lock() defer sess.Lock.Unlock() - close(sess.Timeout) + select { + case <-sess.Timeout: + default: + close(sess.Timeout) + } if r.Method == http.MethodDelete && len(fragments) == 3 { if enableFileUpload { os.RemoveAll(filepath.Join(os.TempDir(), id))