Skip to content

Commit

Permalink
改进接口终端的并发设计
Browse files Browse the repository at this point in the history
Co-Authored-By: 仑质 <[email protected]>
  • Loading branch information
MetaLe0 and lunzhiPenxil committed Jun 12, 2024
1 parent a840707 commit 9c4fa3d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions OlivOS/adapter/virtualTerminal/virtualTerminalLinkServerAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@Desc : None
'''

import gevent
from gevent import pywsgi
from flask import Flask
from flask import current_app
Expand Down Expand Up @@ -139,10 +140,13 @@ def Flask_server_func():
res = json.dumps(self.Proc_data['reply_event_pool'][event_id])
self.Proc_data['reply_event_pool'].pop(event_id)
break
time.sleep(0.25)
gevent.sleep(0.25)
return res, status, header
server = pywsgi.WSGIServer(('0.0.0.0', self.Proc_data['bot_info_dict'].post_info.port),
self.Proc_config['Flask_app'], log=None)
server = pywsgi.WSGIServer(
('0.0.0.0', self.Proc_data['bot_info_dict'].post_info.port),
self.Proc_config['Flask_app'],
log=None
)
server.serve_forever()

def send_init_event(self):
Expand Down

0 comments on commit 9c4fa3d

Please sign in to comment.