Process redundancy stats in series

pull/4149/head
Chocobozzz 2021-06-01 09:28:45 +02:00
parent a7944e89bc
commit d88a3ea5e3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 6 additions and 7 deletions

View File

@ -336,7 +336,7 @@ async function updateVideoFromAP (options: {
}
const to = overrideTo || videoObject.to
const videoData = await videoActivityObjectToDBAttributes(channel, videoObject, to)
const videoData = videoActivityObjectToDBAttributes(channel, videoObject, to)
video.name = videoData.name
video.uuid = videoData.uuid
video.url = videoData.url

View File

@ -8,6 +8,7 @@ import { VideoCommentModel } from '@server/models/video/video-comment'
import { VideoFileModel } from '@server/models/video/video-file'
import { VideoPlaylistModel } from '@server/models/video/video-playlist'
import { ActivityType, ServerStats, VideoRedundancyStrategyWithManual } from '@shared/models'
import * as Bluebird from 'bluebird'
class StatsManager {
@ -106,12 +107,10 @@ class StatsManager {
strategies.push({ strategy: 'manual', size: null })
return Promise.all(
strategies.map(r => {
return VideoRedundancyModel.getStats(r.strategy)
.then(stats => Object.assign(stats, { strategy: r.strategy, totalSize: r.size }))
})
)
return Bluebird.mapSeries(strategies, r => {
return VideoRedundancyModel.getStats(r.strategy)
.then(stats => Object.assign(stats, { strategy: r.strategy, totalSize: r.size }))
})
}
private buildAPPerType () {