~egtann/lanhttp

ced0903a1a51d7b59880d64efdc9b35dd0ad39ce — Evan Tann 1 year, 2 months ago 3924c37
prevent infinite hang on stop
1 files changed, 5 insertions(+), 1 deletions(-)

M lanhttp.go
M lanhttp.go => lanhttp.go +5 -1
@@ 175,7 175,11 @@ func (c *Client) StartUpdating(urls []string, every time.Duration) {
}

func (c *Client) StopUpdating() {
	c.stop <- struct{}{}
	// Send if listening, otherwise do nothing
	select {
	case c.stop <- struct{}{}:
	default:
	}
}

func (c *Client) Do(req *http.Request) (*http.Response, error) {