mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: memoized decorator memory leak (#23139)
This commit is contained in:
committed by
GitHub
parent
ad5ee1ce38
commit
79274eb5bc
@@ -18,6 +18,7 @@ import calendar
|
||||
import logging
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
from functools import lru_cache
|
||||
from time import struct_time
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
@@ -45,8 +46,7 @@ from superset.charts.commands.exceptions import (
|
||||
TimeRangeAmbiguousError,
|
||||
TimeRangeParseFailError,
|
||||
)
|
||||
from superset.constants import NO_TIME_RANGE
|
||||
from superset.utils.memoized import memoized
|
||||
from superset.constants import LRU_CACHE_MAX_SIZE, NO_TIME_RANGE
|
||||
|
||||
ParserElement.enablePackrat()
|
||||
|
||||
@@ -394,7 +394,7 @@ class EvalHolidayFunc: # pylint: disable=too-few-public-methods
|
||||
)
|
||||
|
||||
|
||||
@memoized
|
||||
@lru_cache(maxsize=LRU_CACHE_MAX_SIZE)
|
||||
def datetime_parser() -> ParseResults: # pylint: disable=too-many-locals
|
||||
( # pylint: disable=invalid-name
|
||||
DATETIME,
|
||||
|
||||
Reference in New Issue
Block a user