Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #318 from aandryashin/master
Browse files Browse the repository at this point in the history
Avoid close on closed channel
  • Loading branch information
vania-pooh authored Dec 22, 2017
2 parents ad8a78c + 9904947 commit dc503b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion selenoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit dc503b7

Please sign in to comment.