mirror of
https://github.com/apache/superset.git
synced 2026-08-12 11:11:01 +00:00
feat: add ability to disable cache (#23439)
This commit is contained in:
@@ -944,7 +944,7 @@ class DatasourceEditor extends React.PureComponent {
|
||||
fieldKey="cache_timeout"
|
||||
label={t('Cache timeout')}
|
||||
description={t(
|
||||
'The duration of time in seconds before the cache is invalidated',
|
||||
'The duration of time in seconds before the cache is invalidated. Set to -1 to bypass the cache.',
|
||||
)}
|
||||
control={<TextControl controlId="cache_timeout" />}
|
||||
/>
|
||||
|
||||
@@ -101,6 +101,10 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
|
||||
postPayload: {
|
||||
data: {
|
||||
...currentDatasource,
|
||||
cache_timeout:
|
||||
currentDatasource.cache_timeout === ''
|
||||
? null
|
||||
: currentDatasource.cache_timeout,
|
||||
schema,
|
||||
metrics: currentDatasource?.metrics?.map(
|
||||
(metric: Record<string, unknown>) => ({
|
||||
|
||||
@@ -399,7 +399,7 @@ function PropertiesModal({
|
||||
</StyledFormItem>
|
||||
<StyledHelpBlock className="help-block">
|
||||
{t(
|
||||
"Duration (in seconds) of the caching timeout for this chart. Note this defaults to the dataset's timeout if undefined.",
|
||||
"Duration (in seconds) of the caching timeout for this chart. Set to -1 to bypass the cache. Note this defaults to the dataset's timeout if undefined.",
|
||||
)}
|
||||
</StyledHelpBlock>
|
||||
</FormItem>
|
||||
|
||||
@@ -238,7 +238,7 @@ const ExtraOptions = ({
|
||||
<div className="helper">
|
||||
{t(
|
||||
'Duration (in seconds) of the caching timeout for charts of this database.' +
|
||||
' A timeout of 0 indicates that the cache never expires.' +
|
||||
' A timeout of 0 indicates that the cache never expires, and -1 bypasses the cache.' +
|
||||
' Note this defaults to the global timeout if undefined.',
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user