spacemonkd commented on code in PR #10615:
URL: https://github.com/apache/ozone/pull/10615#discussion_r3534962232
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/capacity.tsx:
##########
@@ -194,17 +203,23 @@ const Capacity: React.FC<object> = () => {
};
// Adjust the polling interval based on DN scan status:
- // fast (5s) while a scan is running, normal (60s) once finished.
- // Honors the auto-reload toggle: if polling is OFF, do nothing.
+ // fast (5s) while a scan is running (regardless of auto-reload toggle, since
+ // the scan is async and must be tracked to completion), normal (60s) once
+ // finished — but only if the user has auto-reload enabled.
React.useEffect(() => {
- if (!autoReload.isPolling) {
- return;
+ if (dnPendingDeletes.data.status !== "FINISHED") {
+ autoReload.startPolling(PENDING_POLL_INTERVAL);
+ } else if (autoReload.isPolling) {
+ // Scan just finished while fast-polling was active.
+ // Switch to normal interval only if the user still wants auto-reload;
+ // otherwise stop so we don't override the toggle.
+ const autoReloadEnabled = sessionStorage.getItem('autoReloadEnabled')
!== 'false';
Review Comment:
One more nit is that we re-read the sessionStorage which is set as part of
auto-reload. If we shift this out to a separate JIRA maybe the best way would
be to expose an `isEnabled` property or accept a query rather than the
component reading raw storage.
The issue with directly reading the storage data is that if the hook changes
the flag then this new change will not be detected here.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]