Przeglądaj źródła

send stream status to frontend

Alexander Belanger 4 lat temu
rodzic
commit
b7422466e6
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      internal/kubernetes/agent.go

+ 7 - 0
internal/kubernetes/agent.go

@@ -788,6 +788,13 @@ func (a *Agent) StreamJobs(namespace string, selectors string, rw *websocket.Web
 					continueVal = jobs.Continue
 				}
 			}
+
+			// at this point, we can return the status finished
+			err := rw.WriteJSON(map[string]interface{}{
+				"streamStatus": "finished",
+			})
+
+			errorchan <- err
 		}()
 
 		for err = range errorchan {