hash the state file name (#4000)
* hash the state file name * forgot to digest my food oop
This commit is contained in:
parent
e1538b75f8
commit
9d8b737b1a
@ -12,6 +12,7 @@ import os
|
||||
import uuid
|
||||
from abc import ABC, abstractmethod
|
||||
from collections import defaultdict
|
||||
from hashlib import md5
|
||||
from pathlib import Path
|
||||
from types import FunctionType, MethodType
|
||||
from typing import (
|
||||
@ -2704,7 +2705,9 @@ class StateManagerDisk(StateManager):
|
||||
Returns:
|
||||
The path for the token.
|
||||
"""
|
||||
return (self.states_directory / f"{token}.pkl").absolute()
|
||||
return (
|
||||
self.states_directory / f"{md5(token.encode()).hexdigest()}.pkl"
|
||||
).absolute()
|
||||
|
||||
async def load_state(self, token: str, root_state: BaseState) -> BaseState:
|
||||
"""Load a state object based on the provided token.
|
||||
|
Loading…
Reference in New Issue
Block a user