summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index bf3b10a..d6a433e 100644
--- a/main.go
+++ b/main.go
@@ -144,7 +144,7 @@ func main() {
tasks[i] = recording.NewRunningTask(
taskConfigs[i],
ctxTasks,
- func() { wg.Add(1) },
+ func() {},
func() { wg.Done() },
logging.NewWrappedLogger(logger, fmt.Sprintf("room %v", task.RoomId)),
)
@@ -155,9 +155,11 @@ func main() {
logger.Printf("Starting tasks...")
for i := range tasks {
+ wg.Add(1)
err := tasks[i].StartTask()
if err != nil {
logger.Printf("Cannot start task %v (room %v): %v. Skip.", i, tasks[i].RoomId, err)
+ wg.Done()
}
}