disabling eventbus on windows, causes deadlock.

This commit is contained in:
Jason Kulatunga 2023-09-13 13:55:44 -07:00
parent ce8efdb753
commit 85986cf95c
1 changed files with 10 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"net/http"
"runtime"
"strings"
)
@ -78,12 +79,15 @@ func (ae *AppEngine) Setup() (*gin.RouterGroup, *gin.Engine) {
secure.POST("/query", handler.QueryResourceFhir)
//server-side-events handler
secure.GET("/events/stream",
middleware.SSEHeaderMiddleware(),
middleware.SSEEventBusServerMiddleware(ae.Logger),
handler.SSEStream,
)
//server-side-events handler (only supported on mac/linux)
// TODO: causes deadlock on Windows
if runtime.GOOS != "windows" {
secure.GET("/events/stream",
middleware.SSEHeaderMiddleware(),
middleware.SSEEventBusServerMiddleware(ae.Logger),
handler.SSEStream,
)
}
}
if ae.Config.GetBool("web.allow_unsafe_endpoints") {