Time some fn

This commit is contained in:
Ming Ming 2022-06-06 18:09:11 +08:00
parent f01ab2f648
commit 5d8e5b25b3

View file

@ -123,8 +123,11 @@ class FileCacheUpdater {
}
}
Future<void> _cacheRemote(Account account, File dir, List<File> remote) {
return appDb.use(
Future<void> _cacheRemote(
Account account, File dir, List<File> remote) async {
final s = Stopwatch()..start();
try {
await appDb.use(
(db) => db.transaction(
[AppDb.dirStoreName, AppDb.file2StoreName], idbModeReadWrite),
(transaction) async {
@ -148,6 +151,9 @@ class FileCacheUpdater {
AppDbDirEntry.toPrimaryKeyForDir(account, remoteDir));
},
);
} finally {
_log.info("[_cacheRemote] Elapsed time: ${s.elapsedMilliseconds}ms");
}
}
/// Remove extra entries from local cache based on remote contents