mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 18:36:19 +00:00
throttle current step emit
This commit is contained in:
parent
52a18c694a
commit
dcf029371d
@ -16,6 +16,10 @@ exports.Executor = Executor;
|
||||
|
||||
inherits(Executor, EventEmitter);
|
||||
|
||||
Executor.prototype.throttledEmit = _(function() {
|
||||
this.emit.apply(this, arguments);
|
||||
}).throttle(1500);
|
||||
|
||||
Executor.prototype._getSources = function(params, callback) {
|
||||
};
|
||||
|
||||
@ -28,14 +32,14 @@ Executor.prototype.run = function(params, callback) {
|
||||
project = _({}).extend(self.project, params);
|
||||
Steppy(
|
||||
function() {
|
||||
self.emit('currentStep', 'get sources');
|
||||
self.throttledEmit('currentStep', 'get sources');
|
||||
self._getSources(project.scm, this.slot());
|
||||
},
|
||||
function(err, scmData) {
|
||||
self.emit('scmData', scmData);
|
||||
var funcs = project.steps.map(function(step, index) {
|
||||
return function() {
|
||||
self.emit('currentStep', step.name);
|
||||
self.throttledEmit('currentStep', step.name);
|
||||
self._runStep(step, this.slot());
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user