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

View file

@ -42,3 +42,4 @@ module.exports =
smokeTest: false smokeTest: false
project_cache_length_ms: 60 * 60 * 24 project_cache_length_ms: 60 * 60 * 24
parallelFileDownloads:1