|
@@ -903,7 +903,7 @@ 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, px=self._get_expire_time())
|
|
|
+ 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))
|
|
|
|
|
|
def handle_release_agent_lock(self, choose_phone_num, saas_id, service_id='00000000000000000'):
|
|
@@ -1050,7 +1050,7 @@ class AgentStateService:
|
|
|
def _get_expire_time(self):
|
|
|
now = datetime.now()
|
|
|
end_of_day = now.replace(hour=23, minute=59, second=59, microsecond=0)
|
|
|
- expire_time = (end_of_day - now).total_seconds() * 1000 # Convert to milliseconds
|
|
|
+ expire_time = (end_of_day - now).total_seconds() # Convert to milliseconds
|
|
|
return int(expire_time)
|
|
|
|
|
|
def _choose_max_idle_time(self, idle_agents: List[AgentStateData]) -> str:
|