mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-28 03:19:38 +00:00
Fix writeEvents race condition.
This required removing the compress middleware from the /events route.
This commit is contained in:
parent
83ae2ba3e6
commit
1c7fb74a1d
6 changed files with 91 additions and 195 deletions
|
|
@ -10,18 +10,16 @@ import (
|
|||
"github.com/navidrome/navidrome/core"
|
||||
"github.com/navidrome/navidrome/model"
|
||||
"github.com/navidrome/navidrome/server"
|
||||
"github.com/navidrome/navidrome/server/events"
|
||||
)
|
||||
|
||||
type Router struct {
|
||||
http.Handler
|
||||
ds model.DataStore
|
||||
broker events.Broker
|
||||
share core.Share
|
||||
ds model.DataStore
|
||||
share core.Share
|
||||
}
|
||||
|
||||
func New(ds model.DataStore, broker events.Broker, share core.Share) *Router {
|
||||
r := &Router{ds: ds, broker: broker, share: share}
|
||||
func New(ds model.DataStore, share core.Share) *Router {
|
||||
r := &Router{ds: ds, share: share}
|
||||
r.Handler = r.routes()
|
||||
return r
|
||||
}
|
||||
|
|
@ -55,10 +53,6 @@ func (n *Router) routes() http.Handler {
|
|||
r.Get("/keepalive/*", func(w http.ResponseWriter, r *http.Request) {
|
||||
_, _ = w.Write([]byte(`{"response":"ok", "id":"keepalive"}`))
|
||||
})
|
||||
|
||||
if conf.Server.DevActivityPanel {
|
||||
r.Handle("/events", n.broker)
|
||||
}
|
||||
})
|
||||
|
||||
return r
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue