saulojb commented on issue #37584:
URL: https://github.com/apache/superset/issues/37584#issuecomment-3841623827
Solved !!!
## Summary
Updates to avoid timeouts and an infinite refresh loop: added a staggered
interval to forced dashboard refreshes and fixed a Tab effect that retriggered
refreshes.
## Files changed
- index.jsx
- Tab.jsx
## What I changed
- index.jsx
- Added `staggerInterval` (from `dashboardInfo.metadata.stagger_time`,
falling back to 5000ms).
- Logged `interval: staggerInterval`.
- Call `onRefresh(chartIds, true, staggerInterval, dashboardInfo.id)` so
forced refreshes are staggered instead of all firing at once.
- Tab.jsx
- Removed `lastRefreshTime` from the `useEffect` dependency list that
triggers refresh when a tab becomes visible.
- Added a comment and an `eslint-disable-next-line
react-hooks/exhaustive-deps` to prevent re-running the effect when
`lastRefreshTime` updates (this previously caused an infinite refresh loop).
## Why
- `force=true` without staggering triggers many cache-bypassing queries
simultaneously, increasing the chance of server timeouts/errors.
- The `Tab` effect reacted to `lastRefreshTime` updates and re-fired
`onRefresh`, creating a loop. Avoiding that dependency prevents re-triggering
while preserving the intended initial refresh behavior.
```
https://drive.google.com/file/d/1_j6Z9D72mYOd2AANqn0qBQaRvDvEX2UM/view?usp=sharing
Compiled version -> assets.zip, replace in the superset/static/ folder
--
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]