mirror of https://github.com/apache/superset.git
viz: cache datetime.now() in query_obj (#955)
It shouldn't be a big deal, and it's pretty cheap on linux, but still :)
This commit is contained in:
parent
061d4f1ac7
commit
cc058e5c9e
|
@ -224,8 +224,9 @@ class BaseViz(object):
|
|||
form_data.get("row_limit", config.get("ROW_LIMIT")))
|
||||
since = form_data.get("since", "1 year ago")
|
||||
from_dttm = utils.parse_human_datetime(since)
|
||||
if from_dttm > datetime.now():
|
||||
from_dttm = datetime.now() - (from_dttm-datetime.now())
|
||||
now = datetime.now()
|
||||
if from_dttm > now:
|
||||
from_dttm = now - (from_dttm - now)
|
||||
until = form_data.get("until", "now")
|
||||
to_dttm = utils.parse_human_datetime(until)
|
||||
if from_dttm > to_dttm:
|
||||
|
|
Loading…
Reference in New Issue