Quellcode durchsuchen

callback event serial

DavidLiu vor 4 Monaten
Ursprung
Commit
cc763035a9
2 geänderte Dateien mit 2 neuen und 6 gelöschten Zeilen
  1. 1 0
      src/core/callcenter/esl/client.py
  2. 1 6
      src/core/callcenter/views.py

+ 1 - 0
src/core/callcenter/esl/client.py

@@ -116,6 +116,7 @@ class InboundClient:
         return self.executors.get(random_index)
 
     def process_esl_event(self, e):
+        registry.FLASK_ACTIVE_THREADS.set(threading.active_count())
         # self.logger.info(json.loads(e.serialize('json')))
         start_time = time.time()
         event_name = EslEventUtil.getEventName(e)

+ 1 - 6
src/core/callcenter/views.py

@@ -1,6 +1,5 @@
 #!/usr/bin/env python3
 # encoding:utf-8
-import threading
 
 from flask import request, render_template_string
 
@@ -13,7 +12,7 @@ from src.core.callcenter.esl.client import InboundClient, OutboundClient
 from src.core.voip.bot import BotAgent
 from . import app
 from .acd import AcdService
-from src.core.callcenter import registry
+
 
 agent = BotAgent(app)
 inbound_client = InboundClient(agent,app)
@@ -25,10 +24,6 @@ acd_service = AcdService(inbound_client, app)
 agent.acd_service = acd_service
 
 
-@app.before_request
-def before_request():
-    registry.FLASK_ACTIVE_THREADS.set(threading.active_count())
-
 @app.route('/')
 def index():
     return render_template_string("""<!DOCTYPE html>