diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-26 13:41:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-26 13:41:15 +0200 |
commit | 8ee37c5f38b0f9b7e97239197d5590109c163250 (patch) | |
tree | d413bfebd188403506372207b26d771714545fbc /server/lib/schedulers | |
parent | 20213fbd2a366dffc35aa7dddad71323893f8d62 (diff) | |
parent | f49b3231d080767128c80dca7630a1ba9950ed12 (diff) | |
download | PeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.tar.gz PeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.tar.zst PeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.zip |
Merge branch 'release/3.2.0' into develop
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 4 |
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 | } |