File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
frontend/src/features/healthcheck/ui Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,12 @@ export const HealthckeckAttemptsComponent = ({ database }: Props) => {
7979
8080 useEffect ( ( ) => {
8181 let interval : number | null = null ;
82+ let isCancelled = false ;
8283
8384 setIsHealthcheckConfigLoading ( true ) ;
8485 healthcheckConfigApi . getHealthcheckConfig ( database . id ) . then ( ( healthcheckConfig ) => {
86+ if ( isCancelled ) return ;
87+
8588 setIsHealthcheckConfigLoading ( false ) ;
8689
8790 if ( healthcheckConfig . isHealthcheckEnabled ) {
@@ -93,17 +96,18 @@ export const HealthckeckAttemptsComponent = ({ database }: Props) => {
9396 if ( period === 'today' ) {
9497 interval = setInterval ( ( ) => {
9598 loadHealthcheckAttempts ( false ) ;
96- } , 60_000 ) ; // 5 seconds
99+ } , 60_000 ) ;
97100 }
98101 }
99102 } ) ;
100103
101104 return ( ) => {
105+ isCancelled = true ;
102106 if ( interval ) {
103107 clearInterval ( interval ) ;
104108 }
105109 } ;
106- } , [ period ] ) ;
110+ } , [ database . id , period ] ) ;
107111
108112 if ( isHealthcheckConfigLoading ) {
109113 return (
You can’t perform that action at this time.
0 commit comments