Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix bug in redundancy eviction

Chocobozzzf8278b96053d
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts
index cd70fd8516..5f4aad66e9 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