|
@@ -30,7 +30,7 @@ class Callback(object):
|
|
|
try:
|
|
|
event, call_info, device_info = self.event_queue.get(timeout=1)
|
|
|
call_type = CallType.get_by_code(call_info.call_type) if call_info else None
|
|
|
- self.logger.info("callback::call_type=%s, call_info=%s", call_type, call_info)
|
|
|
+ # self.logger.info("callback::call_type=%s, call_info=%s", call_type, call_info)
|
|
|
if call_type is None:
|
|
|
continue
|
|
|
if CallType.BOT_CALL == call_type:
|
|
@@ -46,6 +46,7 @@ class Callback(object):
|
|
|
for k, v in self.executors.items():
|
|
|
v.shutdown()
|
|
|
|
|
|
+
|
|
|
def callback_event(self, event):
|
|
|
event_name = EslEventUtil.getEventName(event)
|
|
|
# CUSTOM == event_name or
|
|
@@ -63,14 +64,6 @@ class Callback(object):
|
|
|
self.logger.info("callback::event_name=%s, call_id=%s, device_id=%s", event_name, call_id, device_id)
|
|
|
self.event_queue.put_nowait((event, call_info, device_info))
|
|
|
|
|
|
- # call_type = CallType.get_by_code(call_info.call_type) if call_info else None
|
|
|
- # # self.logger.info("callback::event_name=%s, call_type=%s, call_id=%s, device_id=%s, call_info=%s", event_name, call_type, call_id, device_id, call_info)
|
|
|
- # if CallType.BOT_CALL == call_type:
|
|
|
- # threading.Thread(target=self.agent_event_service.bot_event_channel, args=(event, call_info, device_info)).start()
|
|
|
- # # self.agent_event_service.bot_event_channel(event, call_info, device_info)
|
|
|
- # else:
|
|
|
- # threading.Thread(target=self.agent_event_service.agent_event_channel, args=(event, call_info, device_info)).start()
|
|
|
- # # self.agent_event_service.agent_event_channel(event, call_info, device_info)
|
|
|
|
|
|
def choose_thread_pool_executor(self, e):
|
|
|
call_id = EslEventUtil.getCallId(e)
|
|
@@ -81,5 +74,5 @@ class Callback(object):
|
|
|
random_index = abs(mmh3.hash(random_id)) % len(self.executors)
|
|
|
else:
|
|
|
random_index = random.randint(0, len(self.executors) - 1) if self.executors else 0
|
|
|
- self.logger.info('choose_thread_pool_executor.index %s %s %s %s', random_index, call_id, device_id, wdh_device_id)
|
|
|
+ # self.logger.info('choose_thread_pool_executor.index %s %s %s %s', random_index, call_id, device_id, wdh_device_id)
|
|
|
return self.executors.get(random_index)
|