mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-12-16 08:19:06 +00:00
Fix sleeps
This commit is contained in:
@@ -65,11 +65,8 @@ func scheduleNewTask(c context.Context, remote *OD) bool {
|
||||
|
||||
// Sleep if max number of tasks are active
|
||||
for atomic.LoadInt32(&numActiveTasks) > config.Tasks {
|
||||
select {
|
||||
case <-c.Done():
|
||||
return false
|
||||
case <-time.After(time.Second):
|
||||
return true
|
||||
if !sleep(time.Second, c) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user