Skip to content

Commit

Permalink
Merge pull request #47 from wirepair/fix_blocked_channel
Browse files Browse the repository at this point in the history
always send ready channel when exiting probeDebugPort
  • Loading branch information
wirepair authored Jun 4, 2021
2 parents 0a99a4e + ca30b86 commit 81051b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog (2021)

- 2.1.3 (June 4th): Fix a potential blocked channel if chrome fails to start and debug port probe fails
- 2.1.2 (May 23rd): Update to chrome version 90.0.4430.212
- Implementation of an observer package to allow inspection of messages between gcd/browser by @camswords

Expand Down
4 changes: 2 additions & 2 deletions v2/gcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (

var json = jsoniter.ConfigCompatibleWithStandardLibrary

var GCDVERSION = "v2.1.2"
var GCDVERSION = "v2.1.3"

var (
ErrNoTabAvailable = errors.New("no available tab found")
Expand Down Expand Up @@ -443,6 +443,7 @@ func (c *Gcd) probeDebugPort() error {
defer func() {
ticker.Stop()
timeoutTicker.Stop()
c.readyCh <- struct{}{}
}()

for {
Expand All @@ -453,7 +454,6 @@ func (c *Gcd) probeDebugPort() error {
continue
}
defer resp.Body.Close()
c.readyCh <- struct{}{}
return nil
case <-timeoutTicker.C:
return fmt.Errorf("Unable to contact debugger at %s after %d seconds, gave up", c.apiEndpoint, c.timeout)
Expand Down

0 comments on commit 81051b9

Please sign in to comment.