If no task if found don't print error (#130)

This commit is contained in:
Seif Lotfy سيف لطفي
2016-10-07 01:27:25 +02:00
committed by Pedro Nasser
parent 52cab30056
commit 970412ba88

View File

@@ -34,7 +34,7 @@ func getTask(url string) (*models.Task, error) {
}
if task.ID == "" {
return nil, errors.New("Invalid Task: ID empty")
return nil, nil
}
return &task, nil
}
@@ -124,6 +124,10 @@ func startAsyncRunners(ctx context.Context, wg *sync.WaitGroup, i int, url strin
time.Sleep(1 * time.Second)
continue
}
if task == nil {
time.Sleep(1 * time.Second)
continue
}
log.Info("Picked up task:", task.ID)
log.Info("Running task:", task.ID)