From 98a07e07ed9035746b41f3def6bf570281052ba5 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 23 May 2016 14:31:27 +0100 Subject: [PATCH] parallelFileDownloads defaults to 1, sql can't take it --- services/clsi/app/coffee/ResourceWriter.coffee | 5 ++++- services/clsi/config/settings.defaults.coffee | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/clsi/app/coffee/ResourceWriter.coffee b/services/clsi/app/coffee/ResourceWriter.coffee index 835d45e1a4..e3639006ee 100644 --- a/services/clsi/app/coffee/ResourceWriter.coffee +++ b/services/clsi/app/coffee/ResourceWriter.coffee @@ -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) -> diff --git a/services/clsi/config/settings.defaults.coffee b/services/clsi/config/settings.defaults.coffee index aa5780de77..ae8e132346 100644 --- a/services/clsi/config/settings.defaults.coffee +++ b/services/clsi/config/settings.defaults.coffee @@ -41,4 +41,5 @@ module.exports = url: "http://localhost:3013" smokeTest: false - project_cache_length_ms: 60 * 60 * 24 \ No newline at end of file + project_cache_length_ms: 60 * 60 * 24 + parallelFileDownloads:1 \ No newline at end of file