Fix disk logs rotation

This commit is contained in:
Neeraj Gupta 2021-10-18 00:17:36 +05:30
parent 4383fc90ea
commit 5943e07fb2
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -306,6 +306,7 @@ class SuperLogging {
try {
var date = config.dateFmt.parse(basename(file.path));
dates[file] = date;
files.add(file);
} on FormatException {}
}
@ -318,7 +319,9 @@ class SuperLogging {
var toDelete = files.sublist(0, extra);
for (var file in toDelete) {
try {
await file.delete();
} catch (ignore) {}
}
}