mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-04-18 01:46:43 +00:00
Bugfix: Don't schedule new tasks during shutdown
This commit is contained in:
parent
885af5bb3b
commit
cea6c1658b
@ -21,8 +21,13 @@ var totalQueued int64
|
|||||||
func Schedule(c context.Context, remotes <-chan *OD) {
|
func Schedule(c context.Context, remotes <-chan *OD) {
|
||||||
go Stats(c)
|
go Stats(c)
|
||||||
|
|
||||||
for remote := range remotes {
|
for {
|
||||||
if !scheduleNewTask(c, remote) {
|
select {
|
||||||
|
case remote := <-remotes:
|
||||||
|
if !scheduleNewTask(c, remote) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
case <-c.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user