Skip to content

Commit

Permalink
feat :: 1분 마다
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed Oct 3, 2024
1 parent 6125cc1 commit 54fd317
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/Team/apm/ServiceMap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ServiceMap from '@/components/servicemap';
import { getServicemapData } from '@/utils/apis/apm';
import styled from '@emotion/styled';
import { useEffect } from 'react';
import { useParams } from 'react-router-dom';

export const ServiceMapPage = () => {
Expand All @@ -19,7 +20,14 @@ export const ServiceMapPage = () => {
};

const { startTime, endTime } = getCurrentAndOneMinuteAgo();
const { data, isSuccess } = getServicemapData(teamUUID, startTime, endTime);
const { data, isSuccess, refetch } = getServicemapData(teamUUID, startTime, endTime);

useEffect(() => {
refetch();
const interval = setInterval(refetch, 60000);

return () => clearInterval(interval);
}, [teamUUID]);

return <Wrapper>{isSuccess && <ServiceMap data={data} />}</Wrapper>;
};
Expand Down

0 comments on commit 54fd317

Please sign in to comment.