Skip to content

Commit 02d2043

Browse files
committed
Fix errors in timeout checks
1 parent e4b1ec0 commit 02d2043

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cli/core/search.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ func indexesNeedUpdating(duration string) bool {
134134

135135
now := time.Now()
136136
modTimeThreshold, err := time.ParseDuration(duration)
137-
// Not the most elegant way of handling this error
138-
// but it does its job
139137
if err != nil {
140-
modTimeThreshold, _ = time.ParseDuration("24h")
138+
feedback.Error(tr("Invalid timeout: %s", err))
139+
os.Exit(errorcodes.ErrBadArgument)
141140
}
142141

143142
urls := []string{globals.DefaultIndexURL}

0 commit comments

Comments
 (0)