| | |
| | | |
| | | from db import redis_manager_delegate as redis_manager |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from log_module.log import logger_debug |
| | | from utils import tool |
| | | from utils.tool import CodeDataCacheUtil |
| | | |
| | |
| | | if buy_single_index is not None: |
| | | data_ = (buy_single_index, buy_exec_index, compute_index, nums, count, list(max_num_sets), |
| | | volume_rate) |
| | | |
| | | else: |
| | | _buy_single_index, _buy_exec_index, _compute_index, _nums, _count, _max_num_index, _volume_rate = self.get_buy_compute_start_data_cache( |
| | | code) |
| | | data_ = (_buy_single_index, buy_exec_index, compute_index, nums, count, list(max_num_sets), |
| | | volume_rate) |
| | | logger_debug.info(f"保存买入执行位置信息{code}:{data_}") |
| | | CodeDataCacheUtil.set_cache(self.__buy_compute_index_info_cache, code, data_) |
| | | RedisUtils.setex_async(self.__db, _key, expire, json.dumps(data_)) |
| | | |