Perf: Avoid redundant reading and decrypting all collections (#1133)
This commit is contained in:
commit
9a93ed4de8
1 changed files with 5 additions and 3 deletions
|
@ -92,7 +92,7 @@ class CollectionsService {
|
|||
|
||||
// sync method fetches just sync the collections, not the individual files
|
||||
// within the collection.
|
||||
Future<List<Collection>> sync() async {
|
||||
Future<void> sync() async {
|
||||
_logger.info("Syncing collections");
|
||||
final EnteWatch watch = EnteWatch("syncCollection")..start();
|
||||
final lastCollectionUpdationTime =
|
||||
|
@ -101,7 +101,10 @@ class CollectionsService {
|
|||
// Might not have synced the collection fully
|
||||
final fetchedCollections =
|
||||
await _fetchCollections(lastCollectionUpdationTime);
|
||||
watch.log("remote fetch");
|
||||
watch.log("remote fetch collections ${fetchedCollections.length}");
|
||||
if (fetchedCollections.isEmpty) {
|
||||
return;
|
||||
}
|
||||
final updatedCollections = <Collection>[];
|
||||
int maxUpdationTime = lastCollectionUpdationTime;
|
||||
final ownerID = _config.getUserID();
|
||||
|
@ -152,7 +155,6 @@ class CollectionsService {
|
|||
),
|
||||
);
|
||||
}
|
||||
return collections;
|
||||
}
|
||||
|
||||
void clearCache() {
|
||||
|
|
Loading…
Add table
Reference in a new issue