Fix bug in redundancy eviction

This commit is contained in:
Chocobozzz
2019-09-04 14:40:29 +02:00
parent f01dc977ae
commit f8278b9605

View File

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