Skip to content

Commit fb7ebb7

Browse files
committed
Clear interval when job is done to avoid 100% progress event being fired continuously.
1 parent 75084b9 commit fb7ebb7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Readme.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,11 @@ if (cluster.isMaster) {
378378
var pending = 5
379379
, total = pending;
380380

381-
setInterval(function(){
381+
var interval = setInterval(function(){
382382
job.log('sending!');
383383
job.progress(total - pending, total);
384384
--pending || done();
385+
pending || clearInterval(interval);
385386
}, 1000);
386387
});
387388
}

0 commit comments

Comments
 (0)