aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/videos-redundancy-scheduler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/schedulers/videos-redundancy-scheduler.ts')
-rw-r--r--server/lib/schedulers/videos-redundancy-scheduler.ts8
1 files changed, 4 insertions, 4 deletions
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 {
329 private async isTooHeavy (candidateToDuplicate: CandidateToDuplicate) { 329 private async isTooHeavy (candidateToDuplicate: CandidateToDuplicate) {
330 const maxSize = candidateToDuplicate.redundancy.size 330 const maxSize = candidateToDuplicate.redundancy.size
331 331
332 const { totalUsed: used } = await VideoRedundancyModel.getStats(candidateToDuplicate.redundancy.strategy) 332 const { totalUsed: alreadyUsed } = await VideoRedundancyModel.getStats(candidateToDuplicate.redundancy.strategy)
333 333
334 const videoSize = this.getTotalFileSizes(candidateToDuplicate.files, candidateToDuplicate.streamingPlaylists) 334 const videoSize = this.getTotalFileSizes(candidateToDuplicate.files, candidateToDuplicate.streamingPlaylists)
335 const total = used + videoSize 335 const willUse = alreadyUsed + videoSize
336 336
337 logger.debug('Checking candidate size.', { used, videoSize, total, ...lTags(candidateToDuplicate.video.uuid) }) 337 logger.debug('Checking candidate size.', { maxSize, alreadyUsed, videoSize, willUse, ...lTags(candidateToDuplicate.video.uuid) })
338 338
339 return total > maxSize 339 return willUse > maxSize
340 } 340 }
341 341
342 private buildNewExpiration (expiresAfterMs: number) { 342 private buildNewExpiration (expiresAfterMs: number) {