feat: remove cache of old repositories

This commit is contained in:
tdurieux
2022-10-24 15:12:18 +02:00
parent 2751d300e2
commit 6cab4365b0
3 changed files with 23 additions and 4 deletions

View File

@@ -253,10 +253,15 @@ export default class Repository {
this._model.size = { storage: 0, file: 0 };
this._model.originalFiles = null;
// remove cache
return Promise.all([
this._model.save(),
storage.rm(this._model.repoId + "/"),
]);
return Promise.all([this._model.save(), this.removeCache()]);
}
/**
* Remove the cached files
* @returns
*/
async removeCache() {
return storage.rm(this._model.repoId + "/");
}
/**