Files
2026-07-13 12:31:34 +08:00

25 lines
370 B
Python

# -*- coding: utf-8 -*-
"""
cache_util.py
"""
from diskcache import Cache
from domain_admin.config import CACHE_DIR
# 指定文件夹
cache = Cache(CACHE_DIR)
def set_value(key, value, expire=None):
"""
存,单位:秒s
"""
cache.set(key=key, value=value, expire=expire)
def get_value(key):
"""
"""
return cache.get(key=key)