Browse Source

Fixes #2267: do not cache the pipeline object.

Charles Ezell 12 years ago
parent
commit
0fceeafb44
1 changed files with 6 additions and 2 deletions
  1. 6 2
      lib/Aggregator.js

+ 6 - 2
lib/Aggregator.js

@@ -10,13 +10,17 @@ var Aggregator = module.exports = (function(){
 		if (typeof docSrcs.length !== "number"){
 			docSrcs = [docSrcs];
 		}
-		this.pipeline = new PipelineCommand(docSrcs, pipelineArgs);
+		this.docSrcs = docSrcs;
+		this.pipelineArgs = pipelineArgs;
 	};
 	proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
 
 	// PROTOTYPE MEMBERS
 	proto.execute = function execute(inputs, callback){
-		this.pipeline.run(inputs,function(err, output){
+		//! @ticket #2266: always create a new PipelineCommand just before we use it.
+		var pipeline = new PipelineCommand(this.docSrcs, this.pipelineArgs);
+
+		pipeline.run(inputs,function(err, output){
 			if (err) return callback(err);
 			return callback(null, output.result);
 		});