Skip to content

Commit

Permalink
skip over 1MB file
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmtmmnk committed Feb 27, 2021
1 parent fff89d2 commit c1032a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions filter/fuzzy.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ func (f *fuzzySearch) getFileNames(root string, limit int) ([]string, error) {
if d.IsDir() {
return nil
}

info, err := d.Info()
if err != nil {
util.Logger.Warn("file info error : ", err)
return nil
}

// skip over 1MB file
if info.Size() > 1000000 {
return nil
}

fileNames = append(fileNames, path)
return nil
})
Expand Down

0 comments on commit c1032a7

Please # to comment.