Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/scorekeeper-status-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const App = () => {
const [jobs, setJobs] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [hasError, setHasError] = useState(false);
const [refreshInterval, setRefreshInterval] = useState(500); // Default refresh interval
const [refreshInterval, setRefreshInterval] = useState(5000); // Default refresh interval
const [nominators, setNominators] = useState([]);

const fetchData = useCallback(async () => {
Expand All @@ -66,7 +66,7 @@ const App = () => {
})),
);
setHasError(false);
setRefreshInterval(800); // Reset to faster refresh rate on success
setRefreshInterval(5000); // Reset to faster refresh rate on success
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded value here ?

Comment says "faster", but 5000 is the same value of the REFRESH_INTERVAL constant, which seems to be used for the "Slow down" scenario...

=> maybe we need REFRESH_INTERVAL_FAST and REFRESH_INTERVAL_SLOW ?

} else {
// Handle empty response
console.log("Received empty response");
Expand Down Expand Up @@ -122,12 +122,12 @@ const App = () => {
}, [currentEndpoint]);

useEffect(() => {
const interval = setInterval(fetchData, 500);
const interval = setInterval(fetchData, 5000);
return () => clearInterval(interval);
}, [fetchData]);

useEffect(() => {
const interval = setInterval(fetchNominatorsData, 500);
const interval = setInterval(fetchNominatorsData, 5000);
return () => clearInterval(interval);
}, [fetchNominatorsData]);

Expand Down
2 changes: 1 addition & 1 deletion packages/scorekeeper-status-ui/src/EraStatsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const EraStatsBar = ({ currentEndpoint }) => {
}
};

const interval = setInterval(fetchEraStats, 500);
const interval = setInterval(fetchEraStats, 5000);
return () => clearInterval(interval);
}, [currentEndpoint]);

Expand Down
2 changes: 1 addition & 1 deletion packages/scorekeeper-status-ui/src/HealthCheckBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const HealthCheckBar = ({ currentEndpoint }) => {
}
};

const interval = setInterval(fetchHealthData, 500);
const interval = setInterval(fetchHealthData, 5000);
return () => clearInterval(interval);
}, [currentEndpoint]);

Expand Down