KKcorps commented on code in PR #15657: URL: https://github.com/apache/pinot/pull/15657#discussion_r2062983829
########## pinot-controller/src/main/resources/app/pages/TenantDetails.tsx: ########## @@ -279,6 +304,38 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => { useEffect(() => { fetchTableData(); }, []); + // Fetch pause status once tableType is known + useEffect(() => { + if (tableType.toLowerCase() === TableType.REALTIME) { + setLoadingPauseStatus(true); + PinotMethodUtils.getPauseStatusData(tableName) + .then((data: PauseStatusDetails) => setPauseStatusData(data)) + .catch((error: any) => dispatch({ type: 'error', message: `Error fetching pause status: ${error}`, show: true })) + .finally(() => setLoadingPauseStatus(false)); + } else { + setPauseStatusData(null); + } + }, [tableType, tableName]); + // Cleanup polling on unmount + useEffect(() => { + return () => { + if (pausePollingRef.current) { + clearInterval(pausePollingRef.current); + } + }; + }, []); + // Fetch pause status once tableType is known + useEffect(() => { + if (tableType.toLowerCase() === TableType.REALTIME) { + setLoadingPauseStatus(true); + PinotMethodUtils.getPauseStatusData(tableName) + .then((data: PauseStatusDetails) => setPauseStatusData(data)) + .catch((error: any) => dispatch({ type: 'error', message: `Error fetching pause status: ${error}`, show: true })) + .finally(() => setLoadingPauseStatus(false)); + } else { + setPauseStatusData(null); + } + }, [tableType, tableName]); Review Comment: My bad. Resolved it now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org