config=current_app.config['Cache']) @classmethod def set(cls, key: str, value: str, timeout: int = 600): if not cls.instance.has(key): cls.instance.set(key, value, timeout=timeout) @classmethod def get(cls, key: str): return cls.instance.get...
from flask import current_app class Cache: instance = FlaskCache(current_app, config=current_app.config['Cache']) @classmethod def set(cls, key: str, value: str, timeout: int = 600): if not cls.instance.has(key): cls.instance.set(key, value, timeout=timeout) @classmethod def get(...