Fix bug in redundancy eviction

This commit is contained in:
Chocobozzz 2019-09-04 14:40:29 +02:00
parent f01dc977ae
commit f8278b9605
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View File

@ -241,7 +241,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
} }
private async purgeCacheIfNeeded (candidateToDuplicate: CandidateToDuplicate) { private async purgeCacheIfNeeded (candidateToDuplicate: CandidateToDuplicate) {
while (this.isTooHeavy(candidateToDuplicate)) { while (await this.isTooHeavy(candidateToDuplicate)) {
const redundancy = candidateToDuplicate.redundancy const redundancy = candidateToDuplicate.redundancy
const toDelete = await VideoRedundancyModel.loadOldestLocalThatAlreadyExpired(redundancy.strategy, redundancy.minLifetime) const toDelete = await VideoRedundancyModel.loadOldestLocalThatAlreadyExpired(redundancy.strategy, redundancy.minLifetime)
if (!toDelete) return if (!toDelete) return