parallelFileDownloads defaults to 1, sql can't take it

This commit is contained in:
Henry Oswald 2016-05-23 14:31:27 +01:00
parent d140964c5f
commit 98a07e07ed
2 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,9 @@ mkdirp = require "mkdirp"
OutputFileFinder = require "./OutputFileFinder"
Metrics = require "./Metrics"
logger = require "logger-sharelatex"
settings = require("settings-sharelatex")
parallelFileDownloads = settings.parallelFileDownloads or 1
module.exports = ResourceWriter =
syncResourcesToDisk: (project_id, resources, basePath, callback = (error) ->) ->
@ -16,7 +19,7 @@ module.exports = ResourceWriter =
jobs = for resource in resources
do (resource) =>
(callback) => @_writeResourceToDisk(project_id, resource, basePath, callback)
async.parallelLimit jobs, 5, callback
async.parallelLimit jobs, parallelFileDownloads, callback
_createDirectory: (basePath, callback = (error) ->) ->
fs.mkdir basePath, (err) ->

View file

@ -41,4 +41,5 @@ module.exports =
url: "http://localhost:3013"
smokeTest: false
project_cache_length_ms: 60 * 60 * 24
project_cache_length_ms: 60 * 60 * 24
parallelFileDownloads:1