diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-20 10:33:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-20 10:33:01 +0200 |
commit | 26d7879998c5962014458b3f9c0f150b6a1581a4 (patch) | |
tree | 3606cfa13acb1584988fa6076fa6e716861be067 /server | |
parent | ac84064a6cd21026ed66c53aa830817404c2de3c (diff) | |
download | PeerTube-26d7879998c5962014458b3f9c0f150b6a1581a4.tar.gz PeerTube-26d7879998c5962014458b3f9c0f150b6a1581a4.tar.zst PeerTube-26d7879998c5962014458b3f9c0f150b6a1581a4.zip |
Fix redundancy exceeded quota
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 01af1e9d2..90caed96d 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -269,7 +269,10 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
269 | private getTotalFileSizes (files: VideoFileModel[], playlists: VideoStreamingPlaylistModel[]) { | 269 | private getTotalFileSizes (files: VideoFileModel[], playlists: VideoStreamingPlaylistModel[]) { |
270 | const fileReducer = (previous: number, current: VideoFileModel) => previous + current.size | 270 | const fileReducer = (previous: number, current: VideoFileModel) => previous + current.size |
271 | 271 | ||
272 | return files.reduce(fileReducer, 0) * playlists.length | 272 | const totalSize = files.reduce(fileReducer, 0) |
273 | if (playlists.length === 0) return totalSize | ||
274 | |||
275 | return totalSize * playlists.length | ||
273 | } | 276 | } |
274 | 277 | ||
275 | private async loadAndRefreshVideo (videoUrl: string) { | 278 | private async loadAndRefreshVideo (videoUrl: string) { |