mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
fix: SocketIO JSON dumps with sane defaults
Similar to how `engineio` provides a JSON-compatible module, this change adds a custom JSON encoder with support for additional types. Changing SocketIO's JSON module fixes the encoding issue when the scanning process tried to send a datetime, failing and the frontend not displaying the scanned game (commonly, when it had sibling games)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import socketio # type: ignore
|
||||
from config import REDIS_URL
|
||||
from utils import json as json_module
|
||||
|
||||
|
||||
class SocketHandler:
|
||||
@@ -7,6 +8,7 @@ class SocketHandler:
|
||||
self.socket_server = socketio.AsyncServer(
|
||||
cors_allowed_origins="*",
|
||||
async_mode="asgi",
|
||||
json=json_module,
|
||||
logger=False,
|
||||
engineio_logger=False,
|
||||
client_manager=socketio.AsyncRedisManager(str(REDIS_URL)),
|
||||
|
||||
Reference in New Issue
Block a user