shelkesays commented on code in PR #40512:
URL: https://github.com/apache/superset/pull/40512#discussion_r3339536590


##########
docs/docs/faq.mdx:
##########
@@ -181,6 +181,17 @@ value in milliseconds in the JSON Metadata field:
 Here, the entire dashboard will refresh at once if periodic refresh is on. The 
stagger time of 2.5
 seconds is ignored.
 
+The manual **Refresh dashboard** button also staggers its chart requests. The 
window is controlled
+by the `SUPERSET_DASHBOARD_MANUAL_REFRESH_STAGGER_MS` server config in 
`superset_config.py`. The
+default is `5000` milliseconds, which matches the fallback used for timed 
refresh. A per-dashboard
+`stagger_time` metadata value still wins when it is larger. Set the server 
config to `0` to keep
+the older behavior where every chart request fires at the same time:

Review Comment:
   Thanks for the review. Tracing the actual code path:
   
   When `SUPERSET_DASHBOARD_MANUAL_REFRESH_STAGGER_MS` is set to `0`, the hook 
passes `interval=0` to `onRefresh`, which becomes the `interval` argument 
inside `fetchCharts`. `fetchCharts` then hits its early-return branch at 
`superset-frontend/src/dashboard/actions/dashboardState.ts:748`:
   
   ```ts
   if (!interval) {
     return Promise.all(
       chartList.map(chartKey =>
         Promise.resolve(dispatch(refreshChart(chartKey, force, dashboardId))),
       ),
     ).then(() => undefined);
   }
   ```
   
   The `Math.max(interval, stagger_time || 5000)` calculation a few lines down 
only runs in the staggered branch below this early return, so `stagger_time` is 
not consulted when the server config is `0`. The current wording in the FAQ is 
accurate for that reason.
   
   Leaving the docs as written. Happy to revisit if I am missing something.



-- 
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]

Reply via email to