refactor: reduce LimitedSizeDict size
This commit is contained in:
parent
f4b7e0f5ce
commit
83d784c917
2
state.py
2
state.py
@ -15,5 +15,5 @@ idle_tracker = {"is_idle": False, "last_used": time.time()}
|
|||||||
kill = {"transcript": False}
|
kill = {"transcript": False}
|
||||||
message_responses = LimitedSizeDict()
|
message_responses = LimitedSizeDict()
|
||||||
players = {}
|
players = {}
|
||||||
sponsorblock_cache = LimitedSizeDict(size_limit=100)
|
sponsorblock_cache = LimitedSizeDict()
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
@ -50,7 +50,7 @@ def filter_secrets(text: str, secrets=SECRETS) -> str:
|
|||||||
|
|
||||||
class LimitedSizeDict(OrderedDict):
|
class LimitedSizeDict(OrderedDict):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.size_limit = kwargs.pop("size_limit", 1000)
|
self.size_limit = kwargs.pop("size_limit", 100)
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self._check_size_limit()
|
self._check_size_limit()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user