mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-12-05 08:03:01 +00:00
* Add Responses WebSocket relay support * Fix Responses WebSocket relay protocol issues * Add status to Responses WebSocket errors * Fix Responses WebSocket local error handling * Use Responses error payload for control write failures * Fix WebSocket subprotocol auth handling * fix: address responses websocket CR feedback * fix: truncate responses websocket relay errors * fix: preserve websocket error message * test: cover responses usage output fallback * feat: close active websockets for disabled channels * chore: address websocket manager review feedback * fix: adapt responses websocket relay after rebase * feat: add per-channel Responses WebSocket switch * fix: address responses websocket relay review findings * fix: share Responses WebSocket billing with HTTP and retain existing rate limits
14 lines
427 B
Go
14 lines
427 B
Go
package service
|
|
|
|
import "github.com/QuantumNous/new-api/pkg/wsmanager"
|
|
|
|
const ChannelDisabledCloseReason = "channel disabled or deleted"
|
|
|
|
func CloseActiveWebSocketsForChannel(channelID int, reason string) int {
|
|
return wsmanager.CloseChannelsAndBroadcast([]int{channelID}, reason)
|
|
}
|
|
|
|
func CloseActiveWebSocketsForChannels(channelIDs []int, reason string) int {
|
|
return wsmanager.CloseChannelsAndBroadcast(channelIDs, reason)
|
|
}
|