Skip to content

Commit

Permalink
Upgrade sse to v0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
alinz committed Dec 27, 2024
1 parent 5ce0a8b commit 6bbadb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.1

require (
ella.to/immuta v0.0.3
ella.to/sse v0.0.5
ella.to/sse v0.0.6
ella.to/task v0.0.5
github.com/rs/xid v1.6.0
github.com/urfave/cli/v2 v2.27.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ ella.to/immuta v0.0.3 h1:QCtTvF7Lr5c807KUvPBJVCZLfQt7Rb+LRE6n+XIyLe4=
ella.to/immuta v0.0.3/go.mod h1:0lKIf8Nu+irCQz5pX7lqrQaepMyfNM3zl4kRzK/oLNw=
ella.to/solid v0.0.2 h1:RSxqe/HEbMZ/vcwwDD9xMQV643Q512IcS9IF5KHcp9w=
ella.to/solid v0.0.2/go.mod h1:0+qlRn4069za08wDegNAFUICaKAZCZHKUjav8UEZml0=
ella.to/sse v0.0.5 h1:DHdc/8twQa6jhyK7B1cfeTCjO649vBhNRCu8JL4/+ck=
ella.to/sse v0.0.5/go.mod h1:KtOhMRF/qbSIB64YmrURiyQXr/Jg06/hJ0HLPzwu1+M=
ella.to/sse v0.0.6 h1:3zJui8y5iOfojWku3QZMFKKSinRtAtKivD8u3TrtDU4=
ella.to/sse v0.0.6/go.mod h1:KtOhMRF/qbSIB64YmrURiyQXr/Jg06/hJ0HLPzwu1+M=
ella.to/task v0.0.5 h1:IURW3b38cOgf+/n3eBdyTdSqBZRUVdF/RvO6k2XEAwA=
ella.to/task v0.0.5/go.mod h1:JW2NYqngeUmWczEaRq9WEj9E2QbXATuYELiC0/lWlCo=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
Expand Down
7 changes: 6 additions & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const (
HeaderConsumerId = "X-BUS-CONSUMER-ID"
)

const (
DefaultSsePingTimeout = 30 * time.Second
)

type Handler struct {
mux *http.ServeMux
eventsLog *immuta.Storage
Expand Down Expand Up @@ -111,11 +115,12 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request) {

w.Header().Set(HeaderConsumerId, id)

pusher, err := sse.NewPusher(w)
pusher, err := sse.NewPusher(w, DefaultSsePingTimeout)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
defer pusher.Close()

var startPos int64
if start == StartOldest {
Expand Down

0 comments on commit 6bbadb0

Please sign in to comment.