wal: filter file names in WAL directory by ".wal"

WAL never writes nor needs files without ".wal" suffix.
Thus, safe to filter out only ".wal" files.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
release-3.4
Gyuho Lee 2018-05-18 10:29:48 -07:00
parent fa6d2e2d71
commit 567b47fc3e
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ var errBadWALName = errors.New("bad wal name")
// Exist returns true if there are any files in a given directory.
func Exist(dir string) bool {
names, err := fileutil.ReadDir(dir)
names, err := fileutil.ReadDir(dir, fileutil.WithExt(".wal"))
if err != nil {
return false
}