mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[hotfix] using UTC for caching timestamps
This commit is contained in:
parent
d6689ee700
commit
63785f039c
@ -21,7 +21,7 @@ class CacheLabel extends React.PureComponent {
|
|||||||
updateTooltipContent() {
|
updateTooltipContent() {
|
||||||
const cachedText = this.props.cachedTimestamp ? (
|
const cachedText = this.props.cachedTimestamp ? (
|
||||||
<span>
|
<span>
|
||||||
Loaded data cached <b>{moment(this.props.cachedTimestamp).fromNow()}</b>
|
Loaded data cached <b>{moment.utc(this.props.cachedTimestamp).fromNow()}</b>
|
||||||
</span>) :
|
</span>) :
|
||||||
'Loaded from cache';
|
'Loaded from cache';
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ export function dashboardContainer(dashboard, datasources) {
|
|||||||
done(slice) {
|
done(slice) {
|
||||||
const refresh = slice.getWidgetHeader().find('.refresh');
|
const refresh = slice.getWidgetHeader().find('.refresh');
|
||||||
const data = slice.data;
|
const data = slice.data;
|
||||||
const cachedWhen = moment(data.cached_dttm).fromNow();
|
const cachedWhen = moment.utc(data.cached_dttm).fromNow();
|
||||||
if (data !== undefined && data.is_cached) {
|
if (data !== undefined && data.is_cached) {
|
||||||
refresh
|
refresh
|
||||||
.addClass('danger')
|
.addClass('danger')
|
||||||
|
@ -250,7 +250,7 @@ class BaseViz(object):
|
|||||||
'status': self.status,
|
'status': self.status,
|
||||||
'stacktrace': stacktrace,
|
'stacktrace': stacktrace,
|
||||||
}
|
}
|
||||||
payload['cached_dttm'] = datetime.now().isoformat().split('.')[0]
|
payload['cached_dttm'] = datetime.utcnow().isoformat().split('.')[0]
|
||||||
logging.info("Caching for the next {} seconds".format(
|
logging.info("Caching for the next {} seconds".format(
|
||||||
cache_timeout))
|
cache_timeout))
|
||||||
data = self.json_dumps(payload)
|
data = self.json_dumps(payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user