From 81f328532e366eef171b71810b221a9294dda78f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 21 十二月 2023 14:31:58 +0800
Subject: [PATCH] 买入条件调整/L撤调整

---
 code_attribute/code_data_util.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/code_attribute/code_data_util.py b/code_attribute/code_data_util.py
index aeb5b98..8a6bd99 100644
--- a/code_attribute/code_data_util.py
+++ b/code_attribute/code_data_util.py
@@ -11,6 +11,7 @@
 from db.redis_manager_delegate import RedisUtils
 from utils import tool
 
+__db = 0
 _redisManager = redis_manager.RedisManager(0)
 
 
@@ -29,6 +30,8 @@
 
 # 鑷敱娴侀�氳偂鏈伐鍏风被
 class ZYLTGBUtil:
+    __db = 0
+
     @classmethod
     def save(cls, code, val, unit):
         RedisUtils.setex(_redisManager.getRedis(), "zyltgb-{}".format(code), tool.get_expire(),
@@ -36,6 +39,12 @@
                              float(val) * 10000))
 
     @classmethod
+    def save_async(cls, code, val, unit):
+        RedisUtils.setex_async(cls.__db, "zyltgb-{}".format(code), tool.get_expire(),
+                               round(float(val) * 100000000) if int(unit) == 0 else round(
+                                   float(val) * 10000))
+
+    @classmethod
     def get(cls, code):
         val = RedisUtils.get(_redisManager.getRedis(), "zyltgb-{}".format(code))
         if val is not None:

--
Gitblit v1.8.0