|
@@ -821,8 +821,8 @@ class AgentStateService:
|
|
|
self.logger = app.logger
|
|
|
self.redis_handler = RedisHandler()
|
|
|
self.assigned_recycle_millisecond = 30 * 1000
|
|
|
- self.state_service_id_data_map = defaultdict(dict)
|
|
|
- self.executor = ThreadPoolExecutor(max_workers=10)
|
|
|
+ # self.state_service_id_data_map = defaultdict(dict)
|
|
|
+ # self.executor = ThreadPoolExecutor(max_workers=10)
|
|
|
self.data_handle_server = DataHandleServer(app)
|
|
|
self.agent_monitor_service = AgentMonitorService(app)
|
|
|
self.agent_actionlog_service = AgentActionLogService(app)
|
|
@@ -903,8 +903,10 @@ class AgentStateService:
|
|
|
|
|
|
def handle_lock_agent(self, choose_phone_num, saas_id, service_id='00000000000000000'):
|
|
|
key = self._lock_key(saas_id, service_id, choose_phone_num)
|
|
|
- self.redis_handler.redis.set(key, 1, nx=True, ex=self._get_expire_time())
|
|
|
- self.logger.info('lockAgent %s %s %s'% (saas_id, service_id, choose_phone_num))
|
|
|
+ expire = self._get_expire_time()
|
|
|
+ self.redis_handler.redis.set(key, 1, nx=True, ex=expire)
|
|
|
+ res = self.redis_handler.redis.get(key)
|
|
|
+ self.logger.info('lockAgent %s %s %s %s %s'% (saas_id, service_id, choose_phone_num, expire, res))
|
|
|
|
|
|
def handle_release_agent_lock(self, choose_phone_num, saas_id, service_id='00000000000000000'):
|
|
|
key = self._lock_key(saas_id, service_id, choose_phone_num)
|