From 9a872de13929af14cb2488b98e211ca857d4ee67 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Mon, 19 Apr 2021 08:45:04 -0700 Subject: [PATCH] fix(executor): Ignore not existing metadata. Fixes #5656 (#5695) --- workflow/executor/executor.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/workflow/executor/executor.go b/workflow/executor/executor.go index 7cbb0516321d..3b4877cfedfa 100644 --- a/workflow/executor/executor.go +++ b/workflow/executor/executor.go @@ -942,14 +942,17 @@ func watchFileChanges(ctx context.Context, pollInterval time.Duration, filePath } file, err := os.Stat(filePath) - if err != nil { + if os.IsNotExist(err) { + // noop + } else if err != nil { log.Fatal(err) + } else { + newModTime := file.ModTime() + if modTime != nil && !modTime.Equal(file.ModTime()) { + res <- struct{}{} + } + modTime = &newModTime } - newModTime := file.ModTime() - if modTime != nil && !modTime.Equal(file.ModTime()) { - res <- struct{}{} - } - modTime = &newModTime time.Sleep(pollInterval) } }()