From 9e64f43ae71007889f4923860a69e557aa3b1002 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 24 十二月 2024 14:34:34 +0800 Subject: [PATCH] 统计大单成交信息 --- utils/tool.py | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index 2040d20..ab56534 100644 --- a/utils/tool.py +++ b/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 -- Gitblit v1.8.0