Fix writeEvents race condition.

This required removing the compress middleware from the /events route.
This commit is contained in:
Deluan 2023-04-01 20:51:51 -04:00
parent 83ae2ba3e6
commit 1c7fb74a1d
6 changed files with 91 additions and 195 deletions

View file

@ -31,16 +31,16 @@ import (
func CreateServer(musicFolder string) *server.Server {
sqlDB := db.Db()
dataStore := persistence.New(sqlDB)
serverServer := server.New(dataStore)
broker := events.GetBroker()
serverServer := server.New(dataStore, broker)
return serverServer
}
func CreateNativeAPIRouter() *nativeapi.Router {
sqlDB := db.Db()
dataStore := persistence.New(sqlDB)
broker := events.GetBroker()
share := core.NewShare(dataStore)
router := nativeapi.New(dataStore, broker, share)
router := nativeapi.New(dataStore, share)
return router
}