From: Chocobozzz Date: Wed, 4 Sep 2019 12:40:29 +0000 (+0200) Subject: Fix bug in redundancy eviction X-Git-Tag: v1.4.1~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f8278b96053d42ac46aea17f949325caa03e8a00;p=oweals%2Fpeertube.git Fix bug in redundancy eviction --- diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index cd70fd851..5f4aad66e 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -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