We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c282b11 commit 227ec69Copy full SHA for 227ec69
pkg/app/app.go
@@ -6,6 +6,7 @@ import (
6
"errors"
7
"os"
8
"os/signal"
9
+ "strings"
10
"syscall"
11
"time"
12
@@ -120,7 +121,9 @@ func NewApp(ctx context.Context, opts *ApplicationOptions) error {
120
121
// read the settings file
122
settingsData, err := os.ReadFile(opts.SettingsFile)
123
if err != nil {
- if os.IsNotExist(err) {
124
+ // The file doesn't exist or is not completely written to the system, i.e., not a vaild
125
+ // json file, we will continue on the retry.
126
+ if os.IsNotExist(err) || strings.Contains(err.Error(), "unexpected end of JSON input") {
127
continue
128
}
129
log.Logger().Errorf("failed to read settings file: %v", err)
0 commit comments