utils/tool.py
@@ -21,6 +21,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