chore(deps): bump jkaninda/okapi to v1.0.0

This commit is contained in:
Jonas Kaninda
2026-09-30 11:31:31 +02:00
parent 7596d3b7d9
commit bd1b37393a
5 changed files with 37 additions and 32 deletions
+7 -1
View File
@@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"net/http"
"strconv"
"strings"
@@ -206,8 +207,13 @@ func (h *Handler) Stream(c *okapi.Context) error {
}
}()
return c.SSEStreamWithOptions(ctx, msgs, &okapi.StreamOptions{
err := c.SSEStreamWithOptions(ctx, msgs, &okapi.StreamOptions{
Serializer: &okapi.JSONSerializer{},
PingInterval: 25 * time.Second,
})
// A client closing the stream is how every SSE session ends, not a failure.
if errors.Is(err, context.Canceled) {
return nil
}
return err
}