quick cleanup

This commit is contained in:
Ruben van de Ven 2019-04-01 16:36:51 +02:00
parent 8bbe75b1ea
commit 47db17688d

View file

@ -148,44 +148,23 @@ class Message(object):
# return "test";
async with self.filenameFetchLock:
print(threading.enumerate())
# print(threading.enumerate())
# client = AsyncHTTPClient()
info = {
'text': text,
'variable': True if self.hasVariables() else False
}
# queryString = urllib.parse.urlencode(info)
# request = HTTPRequest(
# url = f"http://localhost:{self.story.panopticon_port}/voice?{queryString}",
# # url = f"http://rubenvandeven.com/",
# method="GET"
# )
# self.logger.log(LOG_BS, request.url)
# response = await client.fetch(request)
s = Context.instance().socket(zmq.REQ) #: :type s: zmq.sugar.Socket
voiceAddr = f"ipc://voice{self.story.hugvey.id}"
s.connect(voiceAddr)
await s.send_json(info)
print('sent now wait')
filename = await s.recv_string()
print('reply', filename)
s.close()
print(threading.enumerate())
# for t in threading.enumerate(): #: :type t: threading.Thread
# if t.name.startswith('ThreadPoolExecutor'):
# faulthandler.dump_traceback()
# exit()
# return "local/voices/static/64/64a016ce38faaac6cc59f6dc8e64cfa6bb81005b.wav"
# if response.code != 200:
# self.logger.critical(f"Error when fetching filename: {response.code} for {queryString}")
# return None
# print(threading.enumerate())
self.logger.debug(f"Fetched audio for {text}")
self.logger.debug(f"Fetched audio for {text}: {filename}")
return filename