Merge pull request #1743 from samalba/fix-runner

This commit is contained in:
Andrea Luzzardi 2022-03-09 16:35:02 -08:00 committed by GitHub
commit 355842faa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -1,4 +0,0 @@
# generated by dagger
dagger.lock
dagger.io
universe.dagger.io

View File

@ -107,6 +107,11 @@ func (r *Runner) initTasks() {
}
func (r *Runner) addTask(t *cueflow.Task) {
// avoid circular dependencies
if _, ok := r.tasks.Load(t.Path().String()); ok {
return
}
r.tasks.Store(t.Path().String(), struct{}{})
for _, dep := range t.Dependencies() {
@ -156,9 +161,9 @@ func (r *Runner) taskFunc(flowVal cue.Value) (cueflow.Runner, error) {
if strings.Contains(err.Error(), "context canceled") {
lg.Error().Dur("duration", time.Since(start)).Str("state", string(task.StateCanceled)).Msg(string(task.StateCanceled))
} else {
lg.Error().Dur("duration", time.Since(start)).Err(err).Str("state", string(task.StateFailed)).Msg(string(task.StateFailed))
lg.Error().Dur("duration", time.Since(start)).Err(compiler.Err(err)).Str("state", string(task.StateFailed)).Msg(string(task.StateFailed))
}
return fmt.Errorf("%s: %w", t.Path().String(), err)
return fmt.Errorf("%s: %w", t.Path().String(), compiler.Err(err))
}
lg.Info().Dur("duration", time.Since(start)).Str("state", string(task.StateCompleted)).Msg(string(task.StateCompleted))