diff --git a/resume.go b/resume.go index 4092a4c..e5da8bf 100644 --- a/resume.go +++ b/resume.go @@ -30,8 +30,6 @@ func LoadResumeTasks(inRemotes chan<- *OD) { } for _, remote := range resumed { - // TODO Cleanup globalWait management - globalWait.Add(1) inRemotes <- remote } } diff --git a/scheduler.go b/scheduler.go index dbab95e..d7ab810 100644 --- a/scheduler.go +++ b/scheduler.go @@ -66,6 +66,7 @@ func scheduleNewTask(c context.Context, remote *OD) bool { }) // Upload result when ready + globalWait.Add(1) go remote.Watch(results) // Sleep if max number of tasks are active @@ -83,7 +84,6 @@ func ScheduleTask(remotes chan<- *OD, t *Task, u *fasturl.URL) { return } - globalWait.Add(1) now := time.Now() od := &OD { Task: *t,