mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-25 08:24:43 +01:00
Time some fn
This commit is contained in:
parent
f01ab2f648
commit
5d8e5b25b3
1 changed files with 29 additions and 23 deletions
|
@ -123,8 +123,11 @@ class FileCacheUpdater {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _cacheRemote(Account account, File dir, List<File> remote) {
|
Future<void> _cacheRemote(
|
||||||
return appDb.use(
|
Account account, File dir, List<File> remote) async {
|
||||||
|
final s = Stopwatch()..start();
|
||||||
|
try {
|
||||||
|
await appDb.use(
|
||||||
(db) => db.transaction(
|
(db) => db.transaction(
|
||||||
[AppDb.dirStoreName, AppDb.file2StoreName], idbModeReadWrite),
|
[AppDb.dirStoreName, AppDb.file2StoreName], idbModeReadWrite),
|
||||||
(transaction) async {
|
(transaction) async {
|
||||||
|
@ -148,6 +151,9 @@ class FileCacheUpdater {
|
||||||
AppDbDirEntry.toPrimaryKeyForDir(account, remoteDir));
|
AppDbDirEntry.toPrimaryKeyForDir(account, remoteDir));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} finally {
|
||||||
|
_log.info("[_cacheRemote] Elapsed time: ${s.elapsedMilliseconds}ms");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove extra entries from local cache based on remote contents
|
/// Remove extra entries from local cache based on remote contents
|
||||||
|
|
Loading…
Add table
Reference in a new issue