diff --git a/.travis.yml b/.travis.yml index 1ae3698..c63c570 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.12.x + - 1.11.x - tip before_install: diff --git a/geziyor.go b/geziyor.go index a86ea29..05da58c 100644 --- a/geziyor.go +++ b/geziyor.go @@ -112,7 +112,6 @@ func (g *Geziyor) Start() { g.Opt.StartRequestsFunc(g) } - time.Sleep(time.Millisecond) g.wg.Wait() log.Println("Scraping Finished") @@ -206,7 +205,9 @@ func (g *Geziyor) do(req *Request, callback func(resp *Response)) { g.Opt.ParseFunc(response) } } - time.Sleep(time.Millisecond) + + // Close exports chan to prevent goroutine leak + close(response.Exports) } func (g *Geziyor) doRequestClient(req *Request) (*Response, error) {