aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-26 09:44:16 +0200
committerChocobozzz <me@florianbigard.com>2021-05-26 09:44:16 +0200
commit53e7f82fe394eff220e1b76aa4d2b6018ed26267 (patch)
tree3537fa5e36753820c5aa13b4b154c875e33bc329 /server/lib
parentceb8f322118b24508abc6dd0bc6813a43610eff3 (diff)
downloadPeerTube-53e7f82fe394eff220e1b76aa4d2b6018ed26267.tar.gz
PeerTube-53e7f82fe394eff220e1b76aa4d2b6018ed26267.tar.zst
PeerTube-53e7f82fe394eff220e1b76aa4d2b6018ed26267.zip
Fix redundancy max size
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/schedulers/videos-redundancy-scheduler.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts
index 9e2667416..59b55cccc 100644
--- a/server/lib/schedulers/videos-redundancy-scheduler.ts
+++ b/server/lib/schedulers/videos-redundancy-scheduler.ts
@@ -317,8 +317,8 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
317 private async isTooHeavy (candidateToDuplicate: CandidateToDuplicate) { 317 private async isTooHeavy (candidateToDuplicate: CandidateToDuplicate) {
318 const maxSize = candidateToDuplicate.redundancy.size 318 const maxSize = candidateToDuplicate.redundancy.size
319 319
320 const totalDuplicated = await VideoRedundancyModel.getTotalDuplicated(candidateToDuplicate.redundancy.strategy) 320 const { totalUsed } = await VideoRedundancyModel.getStats(candidateToDuplicate.redundancy.strategy)
321 const totalWillDuplicate = totalDuplicated + this.getTotalFileSizes(candidateToDuplicate.files, candidateToDuplicate.streamingPlaylists) 321 const totalWillDuplicate = totalUsed + this.getTotalFileSizes(candidateToDuplicate.files, candidateToDuplicate.streamingPlaylists)
322 322
323 return totalWillDuplicate > maxSize 323 return totalWillDuplicate > maxSize
324 } 324 }