24 lines
No EOL
882 B
Python
Executable file
24 lines
No EOL
882 B
Python
Executable file
"""
|
|
Quart Extensions Module
|
|
Provides singleton instances of Quart extensions to ensure consistency across the application.
|
|
Uses python-socketio AsyncServer for native Quart/ASGI compatibility.
|
|
"""
|
|
|
|
import socketio
|
|
import logging
|
|
|
|
# Set up logging for socketio
|
|
socketio_logger = logging.getLogger('socketio')
|
|
socketio_logger.setLevel(logging.WARNING) # Reduce socketio log noise
|
|
|
|
# Create the AsyncServer instance for Quart/ASGI compatibility
|
|
socketio_server = socketio.AsyncServer(
|
|
async_mode='asgi',
|
|
cors_allowed_origins="*",
|
|
ping_timeout=120, # 2 minutes timeout for ping response
|
|
ping_interval=45, # Send ping every 45 seconds
|
|
logger=False, # Disable verbose socketio logging
|
|
engineio_logger=False # Disable verbose engineio logging
|
|
)
|
|
|
|
# Note: This will be wrapped with socketio.ASGIApp in create_app() to integrate with Quart |