diff options
Diffstat (limited to 'server/lib/schedulers/videos-redundancy-scheduler.ts')
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index c49a8c89a..8b7f33539 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -185,11 +185,12 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
185 | } | 185 | } |
186 | 186 | ||
187 | private async isTooHeavy (redundancy: VideosRedundancy, filesToDuplicate: VideoFileModel[]) { | 187 | private async isTooHeavy (redundancy: VideosRedundancy, filesToDuplicate: VideoFileModel[]) { |
188 | const maxSize = redundancy.size - this.getTotalFileSizes(filesToDuplicate) | 188 | const maxSize = redundancy.size |
189 | 189 | ||
190 | const totalDuplicated = await VideoRedundancyModel.getTotalDuplicated(redundancy.strategy) | 190 | const totalDuplicated = await VideoRedundancyModel.getTotalDuplicated(redundancy.strategy) |
191 | const totalWillDuplicate = totalDuplicated + this.getTotalFileSizes(filesToDuplicate) | ||
191 | 192 | ||
192 | return totalDuplicated > maxSize | 193 | return totalWillDuplicate > maxSize |
193 | } | 194 | } |
194 | 195 | ||
195 | private buildNewExpiration (expiresAfterMs: number) { | 196 | private buildNewExpiration (expiresAfterMs: number) { |