From 419633ce9df63d7964872e833faa8b603d4e0ebf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Jul 2016 17:15:29 +0200 Subject: Server: throttle "seedAll" when starting the server --- server/models/video.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/video.js') diff --git a/server/models/video.js b/server/models/video.js index 98f43a06d..396aa505d 100644 --- a/server/models/video.js +++ b/server/models/video.js @@ -1,7 +1,7 @@ 'use strict' const config = require('config') -const each = require('async/each') +const eachLimit = require('async/eachLimit') const ffmpeg = require('fluent-ffmpeg') const fs = require('fs') const parallel = require('async/parallel') @@ -235,7 +235,7 @@ function seedAllExisting (callback) { listOwned.call(this, function (err, videos) { if (err) return callback(err) - each(videos, function (video, callbackEach) { + eachLimit(videos, constants.SEEDS_IN_PARALLEL, function (video, callbackEach) { const videoPath = pathUtils.join(uploadsDir, video.filename) seed(videoPath, callbackEach) }, callback) -- cgit v1.2.3