eventlet monkeypatch
This commit is contained in:
@@ -6,6 +6,8 @@ from .views import register_blueprints
|
|||||||
import atexit
|
import atexit
|
||||||
import logging
|
import logging
|
||||||
import signal
|
import signal
|
||||||
|
import eventlet
|
||||||
|
eventlet.monkey_patch()
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
_shutdown_once = threading.Event()
|
_shutdown_once = threading.Event()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from typing import Optional
|
|||||||
mongo = PyMongo()
|
mongo = PyMongo()
|
||||||
|
|
||||||
|
|
||||||
socketio = SocketIO(cors_allowed_origins="*",max_payload_size=52428800, async_mode="threading") # 不直接传 app
|
socketio = SocketIO(cors_allowed_origins="*",max_payload_size=52428800, async_mode="eventlet") # 不直接传 app
|
||||||
cors = CORS()
|
cors = CORS()
|
||||||
# ===== 你的全局对象 =====
|
# ===== 你的全局对象 =====
|
||||||
# Backboard
|
# Backboard
|
||||||
@@ -40,7 +40,7 @@ def init_extensions(app):
|
|||||||
cors_allowed_origins='*',#app.config["VSCODE_WEB_URL"],
|
cors_allowed_origins='*',#app.config["VSCODE_WEB_URL"],
|
||||||
ping_timeout=app.config["SOCKETIO_PING_TIMEOUT"],
|
ping_timeout=app.config["SOCKETIO_PING_TIMEOUT"],
|
||||||
ping_interval=app.config["SOCKETIO_PING_INTERVAL"],
|
ping_interval=app.config["SOCKETIO_PING_INTERVAL"],
|
||||||
max_payload_size=50000000, async_mode="threading"
|
max_payload_size=50000000, async_mode="eventlet"
|
||||||
)
|
)
|
||||||
cors.init_app(
|
cors.init_app(
|
||||||
app,
|
app,
|
||||||
|
|||||||
Reference in New Issue
Block a user