mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
feat(config): Add none force-refresh option for auto refresh (#17039)
* feat(config): Add none force-refresh option for auto refresh * use general config * fix lint issues * last lint fix
This commit is contained in:
parent
434b5767c9
commit
7a2e39449a
@ -292,11 +292,19 @@ class Header extends React.PureComponent {
|
||||
});
|
||||
this.props.addWarningToast(
|
||||
t(
|
||||
`This dashboard is currently force refreshing; the next force refresh will be in %s.`,
|
||||
`This dashboard is currently auto refreshing; the next auto refresh will be in %s.`,
|
||||
intervalMessage,
|
||||
),
|
||||
);
|
||||
|
||||
if (dashboardInfo.common.conf.DASHBOARD_AUTO_REFRESH_MODE === 'fetch') {
|
||||
// force-refresh while auto-refresh in dashboard
|
||||
return fetchCharts(
|
||||
affectedCharts,
|
||||
false,
|
||||
interval * 0.2,
|
||||
dashboardInfo.id,
|
||||
);
|
||||
}
|
||||
return fetchCharts(
|
||||
affectedCharts,
|
||||
true,
|
||||
|
@ -30,7 +30,17 @@ import re
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
from datetime import date, timedelta
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, TYPE_CHECKING, Union
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Type,
|
||||
TYPE_CHECKING,
|
||||
Union,
|
||||
)
|
||||
|
||||
from cachelib.base import BaseCache
|
||||
from celery.schedules import crontab
|
||||
@ -692,6 +702,8 @@ MAX_TABLE_NAMES = 3000
|
||||
SQLLAB_SAVE_WARNING_MESSAGE = None
|
||||
SQLLAB_SCHEDULE_WARNING_MESSAGE = None
|
||||
|
||||
# Force refresh while auto-refresh in dashboard
|
||||
DASHBOARD_AUTO_REFRESH_MODE: Literal["fetch", "force"] = "force"
|
||||
|
||||
# Default celery config is to use SQLA as a broker, in a production setting
|
||||
# you'll want to use a proper broker as specified here:
|
||||
|
@ -99,6 +99,7 @@ FRONTEND_CONF_KEYS = (
|
||||
"SQLALCHEMY_DOCS_URL",
|
||||
"SQLALCHEMY_DISPLAY_TEXT",
|
||||
"GLOBAL_ASYNC_QUERIES_WEBSOCKET_URL",
|
||||
"DASHBOARD_AUTO_REFRESH_MODE",
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user