Skip to content

Commit 8a20cd3

Browse files
Updated web socket commands
1 parent 28c9d7b commit 8a20cd3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/session/socket.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
/* handle websocket commands from clients */
12-
func (m *Manager)handleWebSocketCommands(conn *websocket.Conn, ctxVal context.Context, cancel context.CancelFunc) {
12+
func (m *Manager) handleWebSocketCommands(conn *websocket.Conn, sessionID string, ctxVal context.Context, cancel context.CancelFunc) {
1313
defer cancel()
1414

1515
/* infinite loop */
@@ -47,6 +47,9 @@ func (m *Manager)handleWebSocketCommands(conn *websocket.Conn, ctxVal context.Co
4747
switch val {
4848
case StreamUserSession:
4949
/* push user session */
50+
if err := m.sendCurrentSession(conn, sessionID); err != nil {
51+
m.errCh<-fmt.Errorf("failed to send current transaction on command: %w", err)
52+
}
5053
case StreamUserTransactions:
5154
/* push user transactions */
5255
case StreamAllSessions:

0 commit comments

Comments
 (0)