From bcdb0c6d6ace12501cec41ee9f5df9fb59da43af Mon Sep 17 00:00:00 2001 From: mizy <1060950782@163.com> Date: Mon, 17 Apr 2023 18:45:38 +0800 Subject: [PATCH] fix: remove fetch balance status --- src/pages/ServiceManage/Overview/index.tsx | 31 +++------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/pages/ServiceManage/Overview/index.tsx b/src/pages/ServiceManage/Overview/index.tsx index 036abbc1..2140c54d 100644 --- a/src/pages/ServiceManage/Overview/index.tsx +++ b/src/pages/ServiceManage/Overview/index.tsx @@ -56,7 +56,6 @@ let interval; const Overview: React.FC = (props: IProps) => { const { cluster, currentSpace, spaces, baseRouter = '/management' } = props; - const [balancing, setBalancing] = useState(false); const modalHandler = useRef(); const [hosts, setHosts] = useState([]); const nebulaRef = useRef<{ @@ -95,7 +94,6 @@ const Overview: React.FC = (props: IProps) => { if (code === 0) { message.success(intl.get('common.successDelay')); props.asyncGetServices(); - getBalanceStatus(); } }; @@ -120,33 +118,12 @@ const Overview: React.FC = (props: IProps) => { if (code === 0) { message.success(intl.get('common.successDelay')); props.asyncGetServices(); - getBalanceStatus(); } handleModalClose(); } }); - }; - - const getBalanceStatus = async () => { - if (!nebulaRef.current.currentSpace) return false; - const { code,data } = await props.getJobs(); - if (code === 0) { - const hasRunningBalance = data.tables.find(item => item.Command.indexOf("BALANCE") && item.status === 'RUNNING'); - setBalancing(hasRunningBalance); - } else { - clearInterval(interval); - } - } - - useEffect(() => { - interval = setInterval(() => { - getBalanceStatus(); - }, 2000); - return ()=>{ - clearInterval(interval); - } - },[]) + }; const handleModalShow = async () => { if (modalHandler && modalHandler.current) { @@ -207,19 +184,17 @@ const Overview: React.FC = (props: IProps) => { )