Always end watch stream if connection to kube-api ends (#217)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-04-04 18:26:42 +03:00
1 parent 1c2298f2af
commit 2593f70184
3 files changed
+9 -12

No files matched your search

+7 -10
View File
@@ -49,16 +49,13 @@ class ApiWatcher {
}
private doneHandler(error: Error) {
if (error) {
logger.error("watch error: " + error.toString())
this.sendEvent({
type: "STREAM_END",
url: this.apiUrl,
status: 410,
})
return
}
this.start()
if (error) logger.warn("watch ended: " + error.toString())
this.sendEvent({
type: "STREAM_END",
url: this.apiUrl,
status: 410,
})
}
private sendEvent(evt: any) {