Fix support for special character passwords (#968)

* Fix special character password support in celery

* Fix celery amqp and socketio password

* Remove non-essential changes
This commit is contained in:
Wu Clan
2025-12-19 14:47:26 +08:00
committed by GitHub
parent 2b76b64e85
commit 7845e1ff49
2 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import urllib.parse
import socketio
from backend.common.log import log
@@ -8,7 +10,7 @@ from backend.database.redis import redis_client
# 创建 Socket.IO 服务器实例
sio = socketio.AsyncServer(
client_manager=socketio.AsyncRedisManager(
f'redis://:{settings.REDIS_PASSWORD}@{settings.REDIS_HOST}:{settings.REDIS_PORT}/{settings.REDIS_DATABASE}',
f'redis://:{urllib.parse.quote(settings.REDIS_PASSWORD)}@{settings.REDIS_HOST}:{settings.REDIS_PORT}/{settings.REDIS_DATABASE}',
),
async_mode='asgi',
cors_allowed_origins=settings.CORS_ALLOWED_ORIGINS,