From c0fcc2dfedbe70054b0223c1a8972e8b4abde952 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Tue, 14 Feb 2017 13:33:29 -0600 Subject: [PATCH] Don't allow "logging" messages after eof is received --- server/stream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/stream.go b/server/stream.go index d4a626a4..1640a1b9 100644 --- a/server/stream.go +++ b/server/stream.go @@ -67,11 +67,15 @@ func LogStream(c *gin.Context) { logs := make(chan []byte) done := make(chan bool) + var eof bool dest := fmt.Sprintf("/topic/logs.%d", job.ID) client, _ := stomp.FromContext(c) sub, err := client.Subscribe(dest, stomp.HandlerFunc(func(m *stomp.Message) { if m.Header.GetBool("eof") { + eof = true done <- true + } else if eof { + return } else { logs <- m.Body }