Added limit on file checking retries
This commit is contained in:
parent
ad6d7e2cd3
commit
3d6e7b0493
|
@ -495,7 +495,7 @@ func pickFile(args []string, filters *Filters, sort string, fileCache *[]string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for true {
|
for i := 0; i < maxRetries; i++ {
|
||||||
i := rand.Intn(len(fileList))
|
i := rand.Intn(len(fileList))
|
||||||
|
|
||||||
filePath := fileList[i]
|
filePath := fileList[i]
|
||||||
|
|
|
@ -17,6 +17,9 @@ const (
|
||||||
// avoid hitting default open file descriptor limits (1024)
|
// avoid hitting default open file descriptor limits (1024)
|
||||||
maxDirectoryScans MaxConcurrency = 32
|
maxDirectoryScans MaxConcurrency = 32
|
||||||
maxFileScans MaxConcurrency = 256
|
maxFileScans MaxConcurrency = 256
|
||||||
|
|
||||||
|
// number of times pickFile() will check for a valid file
|
||||||
|
maxRetries int = 10
|
||||||
)
|
)
|
||||||
|
|
||||||
type Concurrency struct {
|
type Concurrency struct {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version = "0.20.4"
|
var Version = "0.20.5"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(versionCmd)
|
rootCmd.AddCommand(versionCmd)
|
||||||
|
|
Loading…
Reference in New Issue