Skip to content

Commit 1a17780

Browse files
committed
Fix: Capture start time only on successful completion
1 parent 93a602f commit 1a17780

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/helpers/createExtensions.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ function Storage(fn){
1313
this.fn = fn;
1414
this.uid = uid++;
1515
this.name = meta.name;
16+
this.captureTime = Date.now();
1617
this.startHr = [];
1718
}
1819

1920
Storage.prototype.capture = function(){
20-
captureLastRun(this.fn);
21+
captureLastRun(this.fn, this.captureTime);
2122
};
2223

2324
Storage.prototype.release = function(){
@@ -31,7 +32,6 @@ function createExtensions(ee){
3132
},
3233
before: function(storage){
3334
storage.startHr = process.hrtime();
34-
storage.capture();
3535
ee.emit('start', {
3636
uid: storage.uid,
3737
name: storage.name,
@@ -42,6 +42,7 @@ function createExtensions(ee){
4242
if(result && result.state === 'error'){
4343
return this.error(result.value, storage);
4444
}
45+
storage.capture();
4546
ee.emit('stop', {
4647
uid: storage.uid,
4748
name: storage.name,

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"bach": "^0.4.1",
2525
"es6-weak-map": "^1.0.1",
26-
"last-run": "^1.0.0",
26+
"last-run": "^1.1.0",
2727
"lodash": "^3.5.0",
2828
"undertaker-registry": "0.0.2"
2929
},
@@ -36,8 +36,8 @@
3636
"once": "^1.3.1",
3737
"promised-del": "^1.0.2",
3838
"through2": "^0.6.3",
39-
"undertaker-common-tasks": "git://github.com/phated/undertaker-common-tasks",
40-
"undertaker-task-metadata": "git://github.com/undertakerjs/undertaker-task-metadata",
39+
"undertaker-common-tasks": "git://github.com/phated/undertaker-common-tasks#3d3a89ce66cf7397bb00ea9924e12e07db3bf987",
40+
"undertaker-task-metadata": "git://github.com/undertakerjs/undertaker-task-metadata#eb02af6139fcf51a8abb5b7b76a993744512d69d",
4141
"vinyl-fs": "^1.0.0"
4242
},
4343
"keywords": [

0 commit comments

Comments
 (0)