File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -159,16 +159,20 @@ function createHealthStatusTracker(
159159 } ;
160160
161161 let enqueueAgain = false ;
162+
162163 const enqueueUpdateStatus = ( ) => {
163164 if ( healthCheckTimeout ) {
164165 return ;
165166 }
166167
167- healthCheckTimeout = setInterval ( ( ) => {
168+ healthCheckTimeout = setTimeout ( ( ) => {
168169 void fetchAndUpdateStatus ( ) . then ( ( ) => {
169170 if ( ! enqueueAgain ) {
170171 return ;
171172 }
173+
174+ healthCheckTimeout = undefined ;
175+ enqueueUpdateStatus ( ) ;
172176 } ) ;
173177 } , 1_000 ) ;
174178 } ;
@@ -184,7 +188,7 @@ function createHealthStatusTracker(
184188 stop ( ) {
185189 status = undefined ;
186190 enqueueAgain = false ;
187- clearInterval ( healthCheckTimeout ) ;
191+ clearTimeout ( healthCheckTimeout ) ;
188192 healthCheckTimeout = undefined ;
189193 } ,
190194 onChange ( callback ) {
You can’t perform that action at this time.
0 commit comments