Process redundancy stats in series
This commit is contained in:
parent
a7944e89bc
commit
d88a3ea5e3
|
@ -336,7 +336,7 @@ async function updateVideoFromAP (options: {
|
||||||
}
|
}
|
||||||
|
|
||||||
const to = overrideTo || videoObject.to
|
const to = overrideTo || videoObject.to
|
||||||
const videoData = await videoActivityObjectToDBAttributes(channel, videoObject, to)
|
const videoData = videoActivityObjectToDBAttributes(channel, videoObject, to)
|
||||||
video.name = videoData.name
|
video.name = videoData.name
|
||||||
video.uuid = videoData.uuid
|
video.uuid = videoData.uuid
|
||||||
video.url = videoData.url
|
video.url = videoData.url
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { VideoCommentModel } from '@server/models/video/video-comment'
|
||||||
import { VideoFileModel } from '@server/models/video/video-file'
|
import { VideoFileModel } from '@server/models/video/video-file'
|
||||||
import { VideoPlaylistModel } from '@server/models/video/video-playlist'
|
import { VideoPlaylistModel } from '@server/models/video/video-playlist'
|
||||||
import { ActivityType, ServerStats, VideoRedundancyStrategyWithManual } from '@shared/models'
|
import { ActivityType, ServerStats, VideoRedundancyStrategyWithManual } from '@shared/models'
|
||||||
|
import * as Bluebird from 'bluebird'
|
||||||
|
|
||||||
class StatsManager {
|
class StatsManager {
|
||||||
|
|
||||||
|
@ -106,12 +107,10 @@ class StatsManager {
|
||||||
|
|
||||||
strategies.push({ strategy: 'manual', size: null })
|
strategies.push({ strategy: 'manual', size: null })
|
||||||
|
|
||||||
return Promise.all(
|
return Bluebird.mapSeries(strategies, r => {
|
||||||
strategies.map(r => {
|
return VideoRedundancyModel.getStats(r.strategy)
|
||||||
return VideoRedundancyModel.getStats(r.strategy)
|
.then(stats => Object.assign(stats, { strategy: r.strategy, totalSize: r.size }))
|
||||||
.then(stats => Object.assign(stats, { strategy: r.strategy, totalSize: r.size }))
|
})
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private buildAPPerType () {
|
private buildAPPerType () {
|
||||||
|
|
Loading…
Reference in New Issue