From 97e478d8a55d7c2e261aec2cdea0ee09b69a7ffb Mon Sep 17 00:00:00 2001 From: anatoleam Date: Sun, 3 Dec 2023 21:37:44 -0600 Subject: [PATCH] fix: eventstream subscription string ack --- internal/app/routes.go | 2 +- internal/app/v3/v3.go | 4 ++-- terraform/variables.tf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/app/routes.go b/internal/app/routes.go index 691ba10..1c6286a 100644 --- a/internal/app/routes.go +++ b/internal/app/routes.go @@ -3,7 +3,7 @@ package app func (s *Server) setRoutes() { s.router.Use(s.Middleware()) s.router.HandleFunc("/v3", s.handleV3) - s.router.HandleFunc("/v3{sub?:\\@(.*)}", s.handleV3) + s.router.HandleFunc("/v3{sub:\\@(.*)}", s.handleV3) s.router.HandleFunc("/health", s.HandleHealth) } diff --git a/internal/app/v3/v3.go b/internal/app/v3/v3.go index 437ccdb..c4d02fe 100644 --- a/internal/app/v3/v3.go +++ b/internal/app/v3/v3.go @@ -35,8 +35,6 @@ func SSE(gctx global.Context, conn client.Connection, w http.ResponseWriter, r * conn.SetWriter(bufio.NewWriter(w), f) - conn.Read(gctx) - go func() { <-conn.OnReady() // wait for the connection to be ready if conn.Context().Err() != nil { @@ -83,5 +81,7 @@ func SSE(gctx global.Context, conn client.Connection, w http.ResponseWriter, r * } }() + conn.Read(gctx) + return nil } diff --git a/terraform/variables.tf b/terraform/variables.tf index 62b7ac4..90bee9c 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -39,7 +39,7 @@ variable "image_pull_policy" { variable "heartbeat_interval" { type = number - default = 28000 + default = 45000 } variable "subscription_limit" {