Skip to content

Commit 8839da3

Browse files
committed
add initial heartbeat
1 parent 8be8ed9 commit 8839da3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/api/handlers/update.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ func HandleUpdateEvents(updater *update.Manager) http.HandlerFunc {
140140
slog.Info("SSE stream closed", slog.String("client", r.RemoteAddr))
141141
}()
142142

143+
// Send an initial heartbeat to return a feedback to the client
144+
sseStream.Send(render.SSEEvent{Type: "heartbeat"})
145+
143146
ch := updater.Subscribe()
144147
defer updater.Unsubscribe(ch)
145148

0 commit comments

Comments
 (0)