Remove keepalive

This commit is contained in:
2024-04-12 20:08:18 -06:00
parent 4f5afcda70
commit b5f3302a96
4 changed files with 6 additions and 25 deletions

View File

@ -6,7 +6,6 @@ import (
"log"
"net/http"
"sync"
"time"
"atri.dad/lib/pubsub"
"github.com/labstack/echo/v4"
@ -90,19 +89,6 @@ func SetSSEHeaders(c echo.Context) {
c.Response().Header().Set(echo.HeaderCacheControl, "no-cache")
}
func CreateTickerAndKeepAlive(c echo.Context, duration time.Duration) *time.Ticker {
ticker := time.NewTicker(duration)
go func() {
for range ticker.C {
if _, err := c.Response().Write([]byte(": keep-alive\n\n")); err != nil {
log.Printf("Failed to write keep-alive: %v", err)
}
c.Response().Flush()
}
}()
return ticker
}
func HandleIncomingMessages(c echo.Context, pubsub pubsub.PubSubMessage, client chan string) {
for {
select {