Administrator
2024-12-24 9e64f43ae71007889f4923860a69e557aa3b1002
utils/tool.py
@@ -22,6 +22,22 @@
    return wrapper
def singleton(cls):
    """
    单例装饰器
    @param cls:
    @return:
    """
    instances = {}
    def get_instance(*args, **kwargs):
        if cls not in instances:
            instances[cls] = cls(*args, **kwargs)
        return instances[cls]
    return get_instance
def get_expire():
    now = int(t.time())
    end = int(t.time()) + 60 * 60 * 24