| | |
| | | import logging |
| | | import threading |
| | | |
| | | from db.redis_manager import RedisUtils |
| | | from ths import client_manager |
| | | from code_attribute import gpcode_manager |
| | | from l2 import l2_data_manager |
| | |
| | | # 设置代码操作状态,服务器保存的代码是否与实际设置的代码保持一致 |
| | | @classmethod |
| | | def set_operate_code_state(cls, client_id, channel, state): |
| | | cls.getRedis().setex("code-operate_state-{}-{}".format(client_id, channel), 10, state) |
| | | RedisUtils.setex(cls.getRedis(),"code-operate_state-{}-{}".format(client_id, channel), 10, state) |
| | | |
| | | def get_operate_code_state(self, client_id, channel): |
| | | value = self.getRedis().get("code-operate_state-{}-{}".format(client_id, channel)) |
| | |
| | | @classmethod |
| | | def set_read_queue_valid(cls): |
| | | redis = cls.getRedis() |
| | | redis.setex("operate_queue_read_state", 20, 1) |
| | | RedisUtils.setex( redis,"operate_queue_read_state", 20, 1) |
| | | |
| | | @classmethod |
| | | def is_read_queue_valid(cls): |