Fixed goroutine leaks. Updated travis build
This commit is contained in:
parent
f5b3b0d049
commit
4799b0f7b4
@ -1,7 +1,7 @@
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.12.x
|
- 1.11.x
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user