@@ -119,7 +119,6 @@ class WatcherQueue {
119119 private readonly nextQueue : ( ( value ?: ChangedFiles ) => void ) [ ] = [ ] ;
120120 private currentChangedFiles : ChangedFiles | undefined ;
121121 private isClosed = false ;
122- private timeoutId : NodeJS . Timeout | undefined ;
123122
124123 addChange ( type : 'added' | 'modified' | 'removed' , file : string ) : void {
125124 if ( this . isClosed ) {
@@ -128,7 +127,7 @@ class WatcherQueue {
128127
129128 const changedFiles = ( this . currentChangedFiles ??= new ChangedFiles ( ) ) ;
130129 changedFiles [ type ] . add ( file ) ;
131- this . scheduleFlush ( ) ;
130+ this . flush ( ) ;
132131 }
133132
134133 addChanges (
@@ -142,17 +141,7 @@ class WatcherQueue {
142141 for ( const { type, file } of changes ) {
143142 changedFiles [ type ] . add ( file ) ;
144143 }
145- this . scheduleFlush ( ) ;
146- }
147-
148- private scheduleFlush ( ) : void {
149- if ( this . timeoutId ) {
150- clearTimeout ( this . timeoutId ) ;
151- }
152- this . timeoutId = setTimeout ( ( ) => {
153- this . timeoutId = undefined ;
154- this . flush ( ) ;
155- } , 250 ) ;
144+ this . flush ( ) ;
156145 }
157146
158147 private flush ( ) : void {
@@ -174,8 +163,7 @@ class WatcherQueue {
174163 if (
175164 this . currentChangedFiles &&
176165 this . currentChangedFiles . all . length > 0 &&
177- this . nextQueue . length === 0 &&
178- ! this . timeoutId
166+ this . nextQueue . length === 0
179167 ) {
180168 const result = { value : this . currentChangedFiles } ;
181169 this . currentChangedFiles = undefined ;
@@ -199,11 +187,6 @@ class WatcherQueue {
199187 return ;
200188 }
201189
202- if ( this . timeoutId ) {
203- clearTimeout ( this . timeoutId ) ;
204- this . timeoutId = undefined ;
205- }
206-
207190 this . isClosed = true ;
208191 this . currentChangedFiles = undefined ;
209192
0 commit comments