From fdad7aa4b257bacb6fcd2219a917a5e218a81519 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 8 Nov 2024 04:48:57 -0800 Subject: [PATCH] fix --- .../engine/server/engine_connect_server_service.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 25faf3f011..7b40725544 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -358,16 +358,20 @@ func (service *EngineConnectServerService) GetServiceLogs(ctx context.Context, c } //client cancel ctx case case <-contextWithCancel.Done(): + if len(serviceLogsByServiceUuidChan) == 0 { + return nil + } logrus.Debug("The user service logs stream has done") - return nil //error from logs database case case err, isChanOpen := <-errChan: if isChanOpen { logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") return stacktrace.Propagate(err, "An error occurred streaming user service logs.") } - logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") - return nil + if len(serviceLogsByServiceUuidChan) == 0 { + logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") + return nil + } } } }