Skip to content

Commit

Permalink
Added some garbabe collecting related to issue #55
Browse files Browse the repository at this point in the history
  • Loading branch information
LudekStoklasa committed Jan 17, 2022
1 parent 3cd2cef commit 34cb4fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/contentDirectoryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class ContentDirectoryService extends Service {
});
break;
case 'removed':
this._garbageCollection(collection);
this._garbageNonCollectionFiles(collections);
break;
}
Expand All @@ -322,6 +323,14 @@ class ContentDirectoryService extends Service {
}, callback);
}

_garbageCollection(collection) {
this.repositories.forEach((item, index) => {
if (item.collectionID == collection.id) {
this.repositories.splice(index, 1);
}
});
}

_garbageNonCollectionFiles(collections, callback) {
var folders = [];
for (var col of collections) {
Expand Down

0 comments on commit 34cb4fc

Please sign in to comment.