dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
+13 -4
View File
@@ -4,11 +4,20 @@ import '../api/request_cache.dart';
class DataCleaner {
static Future<void> cleanOldCache() async {
final cacheData = await Localstore.instance.collection(RequestCache.collection).get();
final cacheData = await Localstore.instance
.collection(RequestCache.collection)
.get();
cacheData?.forEach((key, value) async {
final lastUpdate = DateTime.fromMillisecondsSinceEpoch(value['lastupdate'] as int);
if (DateTime.now().subtract(const Duration(days: 200)).isAfter(lastUpdate)) {
await Localstore.instance.collection(RequestCache.collection).doc(key.split('/').last).delete();
final lastUpdate = DateTime.fromMillisecondsSinceEpoch(
value['lastupdate'] as int,
);
if (DateTime.now()
.subtract(const Duration(days: 200))
.isAfter(lastUpdate)) {
await Localstore.instance
.collection(RequestCache.collection)
.doc(key.split('/').last)
.delete();
}
});
}