Skip to content

Commit

Permalink
do not kill the connection on error (#133)
Browse files Browse the repository at this point in the history
* do not kill the connection if an error happens during the execution of a command
  • Loading branch information
ToniRamirezM authored Aug 9, 2024
1 parent 3039179 commit 77bea0f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions datastreamer/streamserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const (
maxConnections = 100 // Maximum number of connected clients
streamBuffer = 256 // Buffers for the stream channel
maxBookmarkLength = 16 // Maximum number of bytes for a bookmark

timeout = 2 * time.Second
)

const (
Expand Down Expand Up @@ -342,10 +340,7 @@ func (s *StreamServer) handleConnection(conn net.Conn) {
log.Debugf("Command %d[%s] received from %s", command, StrCommand[Command(command)], clientID)
err = s.processCommand(Command(command), s.getSafeClient(clientID))
if err != nil {
// Kill client connection
time.Sleep(timeout)
s.killClient(clientID)
return
log.Errorf("Error processing command %d[%s] from %s: %v", command, StrCommand[Command(command)], clientID, err)
}
}
}
Expand Down

0 comments on commit 77bea0f

Please sign in to comment.