Fix .no_recover files never being cleaned up (fixes #497)
This commit is contained in:
@@ -325,6 +325,18 @@ public class ReplayMod implements Module, Scheduler {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Cleanup leftover no_recover files
|
||||
try (DirectoryStream<Path> paths = Files.newDirectoryStream(getReplayFolder())) {
|
||||
for (Path path : paths) {
|
||||
String name = path.getFileName().toString();
|
||||
if (name.endsWith(".no_recover")) {
|
||||
Files.delete(path);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user