Fixed goroutine leaks. Updated travis build

This commit is contained in:
Musab Gültekin 2019-06-14 17:30:49 +03:00
parent f5b3b0d049
commit 4799b0f7b4
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
language: go language: go
go: go:
- 1.12.x - 1.11.x
- tip - tip
before_install: before_install:

View File

@ -112,7 +112,6 @@ func (g *Geziyor) Start() {
g.Opt.StartRequestsFunc(g) g.Opt.StartRequestsFunc(g)
} }
time.Sleep(time.Millisecond)
g.wg.Wait() g.wg.Wait()
log.Println("Scraping Finished") log.Println("Scraping Finished")
@ -206,7 +205,9 @@ func (g *Geziyor) do(req *Request, callback func(resp *Response)) {
g.Opt.ParseFunc(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) { func (g *Geziyor) doRequestClient(req *Request) (*Response, error) {