Skip to content

Commit

Permalink
fix: clear wg after handle command
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenrinzema committed Sep 1, 2023
1 parent 2c0a64a commit c268d71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ func (srv *Server) consumeCommands(ctx context.Context, conn net.Conn, reader *b
// NOTE: we increase the wait group by one in order to make sure that idle
// connections are not blocking a close.
srv.wg.Add(1)
defer srv.wg.Done()

srv.logger.Debug("incoming command", slog.Int("length", length), slog.String("type", string(t)))
err = srv.handleCommand(ctx, conn, t, reader, writer)
srv.wg.Done()
if errors.Is(err, io.EOF) {
return nil
}
Expand Down

0 comments on commit c268d71

Please sign in to comment.