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
parent
fa6d2e2d71
commit
567b47fc3e
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue