@@ -56,11 +56,12 @@ function Runner(emitter, config) {
5656 logger : console ,
5757 processJob : core . process ,
5858 pluginDir : path . join ( __dirname , '../node_modules' ) ,
59- dataDir : process . env . STRIDER_CLONE_DEST || dotStrider
59+ dataDir : process . env . STRIDER_CLONE_DEST || dotStrider ,
60+ concurrentJobs : parseInt ( process . env . CONCURRENT_JOBS || '1' , 10 ) || 1 ,
6061 } , config )
6162 this . emitter = emitter
6263 this . log = this . config . logger . log
63- this . queue = async . queue ( this . processJob . bind ( this ) , 1 )
64+ this . queue = async . queue ( this . processJob . bind ( this ) , this . config . concurrentJobs )
6465 this . io = this . config . io
6566 this . callbackMap = { }
6667 this . hooks = [ ]
@@ -295,7 +296,9 @@ Runner.prototype = {
295296 // Keep around N most recent build directories.
296297 // Default is 0, ie wipe at start of each run.
297298 // Later, this can be configurable in the UI.
298- keeper ( { baseDir : path . join ( this . config . dataDir , "data" ) , count : 0 } , function ( err ) {
299+ keeper ( { baseDir : path . join ( this . config . dataDir , "data" ) , count : this . config . concurrentJobs - 1 } , function ( err ) {
300+ if ( err ) throw err ;
301+
299302 initJobDirs ( self . config . dataDir , job , cache . base , jobDirsReady )
300303 } )
301304
@@ -373,4 +376,3 @@ Runner.prototype = {
373376 } ;
374377 }
375378} ;
376-
0 commit comments