File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ var bsconfig = "bsconfig.json";
15
15
var bsb_exe = path . join ( __dirname , process . platform , "rescript.exe" ) ;
16
16
17
17
var LAST_BUILD_START = 0 ;
18
+ var LAST_FIRED_EVENT = 0 ;
18
19
/**
19
20
* @type {[string,string][] }
20
21
*/
502
503
var event_time = + Date . now ( ) ;
503
504
var time_diff = event_time - LAST_BUILD_START ;
504
505
dlog ( `Since last build : ${ time_diff } ` ) ;
505
- if ( time_diff < 5 ) {
506
+ if ( time_diff < 5 || event_time - LAST_FIRED_EVENT < 5 ) {
506
507
// for 5ms, we could think that the ninja not get
507
508
// kicked yet, so there is really no need
508
509
// to send more events here
512
513
// save the event loop call `setImmediate`
513
514
return ;
514
515
}
516
+ LAST_FIRED_EVENT = event_time ;
515
517
if ( validEvent ( event , reason ) ) {
516
518
dlog ( `Event ${ event } ${ reason } ` ) ;
517
519
reasons_to_rebuild . push ( [ event , reason ] ) ;
You can’t perform that action at this time.
0 commit comments