on main help sign in
perf: remove hot-path slog.Info from SSE event delivery (#2929)
c433fd6Tai Groot
internal/client/proto.go−1
@@ -179,7 +179,6 @@ func (c *Client) SubscribeEvents(ctx context.Context, id string) (<-chan any, er
179}
179}
180
180
181func sendEvent(ctx context.Context, evc chan any, ev any) {
181func sendEvent(ctx context.Context, evc chan any, ev any) {
182− slog.Info("Event received", "event", fmt.Sprintf("%T %+v", ev, ev))
183 select {
182 select {
184 case evc <- ev:
183 case evc <- ev:
185 case <-ctx.Done():
184 case <-ctx.Done():
internal/server/proto.go−1
@@ -218,7 +218,6 @@ func (c *controllerV1) handleGetWorkspaceEvents(w http.ResponseWriter, r *http.R
218 if !ok {
218 if !ok {
219 return
219 return
220 }
220 }
221− c.server.logDebug(r, "Sending event", "event", fmt.Sprintf("%T %+v", ev.Payload, ev.Payload))
222 wrapped := wrapEvent(ev.Payload)
221 wrapped := wrapEvent(ev.Payload)
223 if wrapped == nil {
222 if wrapped == nil {
224 continue
223 continue