| | |
| | | codes.append(key.replace("trade-state-", '')) |
| | | return codes |
| | | finally: |
| | | redis.connection_pool.disconnect() |
| | | RedisUtils.realse(redis) |
| | | |
| | | |
| | | def get_codes_by_trade_states(states): |
| | |
| | | codes.append(key.replace("trade-state-", '')) |
| | | return codes |
| | | finally: |
| | | redis.connection_pool.disconnect() |
| | | RedisUtils.realse(redis) |
| | | |
| | | |
| | | # 设置交易账户的可用金额 |
| | |
| | | else: |
| | | return json.loads(result), time_str |
| | | finally: |
| | | redis.connection_pool.disconnect() |
| | | RedisUtils.realse(redis) |
| | | |
| | | |
| | | # 开始交易 |
| | |
| | | # if (k.find("l2-") is None or k.find("l2-") < 0) and (k.find("big_data-") is None or k.find("big_data-") < 0): |
| | | RedisUtils.delete(redis_l2, k, auto_free=False) |
| | | finally: |
| | | redis_l2.connection_pool.disconnect() |
| | | RedisUtils.realse(redis_l2) |
| | | |
| | | RedisUtils.delete(redis_manager.RedisManager(2).getRedis(), "trade-state-{}".format(code)) |
| | | |
| | |
| | | |
| | | RedisUtils.delete(redis_info, k, auto_free=False) |
| | | finally: |
| | | redis_info.connection_pool.disconnect() |
| | | RedisUtils.realse(redis_info) |
| | | |
| | | |
| | | def __clear_big_data(): |
| | |
| | | for k in keys: |
| | | RedisUtils.delete(redis_l2, k, auto_free=False) |
| | | finally: |
| | | redis_l2.connection_pool.disconnect() |
| | | RedisUtils.realse(redis_l2) |
| | | |
| | | |
| | | if __name__ == "__main__": |