mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
Allow 'refresh_immune_slices' (#2974)
* Allow 'refresh_immune_slices' * Changed param name, added note in FAQ * Linting
This commit is contained in:
committed by
Maxime Beauchemin
parent
90592d3e3d
commit
163f4e359c
@@ -245,15 +245,18 @@ export function dashboardContainer(dashboard, datasources, userid) {
|
||||
startPeriodicRender(interval) {
|
||||
this.stopPeriodicRender();
|
||||
const dash = this;
|
||||
const immune = this.metadata.timed_refresh_immune_slices || [];
|
||||
const maxRandomDelay = Math.max(interval * 0.2, 5000);
|
||||
const refreshAll = () => {
|
||||
dash.sliceObjects.forEach((slice) => {
|
||||
const force = !dash.firstLoad;
|
||||
setTimeout(() => {
|
||||
slice.render(force);
|
||||
},
|
||||
// Randomize to prevent all widgets refreshing at the same time
|
||||
maxRandomDelay * Math.random());
|
||||
if (immune.indexOf(slice.data.slice_id) === -1) {
|
||||
setTimeout(() => {
|
||||
slice.render(force);
|
||||
},
|
||||
// Randomize to prevent all widgets refreshing at the same time
|
||||
maxRandomDelay * Math.random());
|
||||
}
|
||||
});
|
||||
dash.firstLoad = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user