backup
This commit is contained in:
@@ -439,8 +439,8 @@ class NotificationService:
|
||||
|
||||
logger.info(f"資料庫通知已創建: {notification.notification_uuid} for user {user_id}")
|
||||
|
||||
# 觸發 WebSocket 推送
|
||||
self._send_websocket_notification(notification)
|
||||
# WebSocket 推送已禁用
|
||||
# self._send_websocket_notification(notification)
|
||||
|
||||
return notification
|
||||
|
||||
@@ -611,16 +611,14 @@ class NotificationService:
|
||||
|
||||
def _send_websocket_notification(self, notification: Notification):
|
||||
"""
|
||||
通過 WebSocket 發送通知
|
||||
|
||||
通過 WebSocket 發送通知 - 已禁用
|
||||
|
||||
Args:
|
||||
notification: 通知對象
|
||||
"""
|
||||
try:
|
||||
from app.websocket import send_notification_to_user
|
||||
send_notification_to_user(notification.user_id, notification.to_dict())
|
||||
except Exception as e:
|
||||
logger.error(f"WebSocket 推送通知失敗: {e}")
|
||||
# WebSocket 功能已完全禁用
|
||||
logger.debug(f"WebSocket 推送已禁用,跳過通知: {notification.notification_uuid}")
|
||||
pass
|
||||
|
||||
def get_unread_count(self, user_id: int) -> int:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user