From 0bae66632a8767f3d5aca080af314bcab56e1889 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Aug 2021 15:19:11 +0200 Subject: More logs for webtorrent download --- server/lib/schedulers/videos-redundancy-scheduler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/schedulers/videos-redundancy-scheduler.ts') diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index d9988157d..633cbcf6c 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -329,14 +329,14 @@ export class VideosRedundancyScheduler extends AbstractScheduler { private async isTooHeavy (candidateToDuplicate: CandidateToDuplicate) { const maxSize = candidateToDuplicate.redundancy.size - const { totalUsed: used } = await VideoRedundancyModel.getStats(candidateToDuplicate.redundancy.strategy) + const { totalUsed: alreadyUsed } = await VideoRedundancyModel.getStats(candidateToDuplicate.redundancy.strategy) const videoSize = this.getTotalFileSizes(candidateToDuplicate.files, candidateToDuplicate.streamingPlaylists) - const total = used + videoSize + const willUse = alreadyUsed + videoSize - logger.debug('Checking candidate size.', { used, videoSize, total, ...lTags(candidateToDuplicate.video.uuid) }) + logger.debug('Checking candidate size.', { maxSize, alreadyUsed, videoSize, willUse, ...lTags(candidateToDuplicate.video.uuid) }) - return total > maxSize + return willUse > maxSize } private buildNewExpiration (expiresAfterMs: number) { -- cgit v1.2.3