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>
@@ -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
}