Skip to content

Commit

Permalink
fix(k8s): fix port-forward error handling
Browse files Browse the repository at this point in the history
This should fix an error that some users have run into when using
watch-mode commands when services are redeployed.
  • Loading branch information
thsig committed Oct 4, 2021
1 parent 7964030 commit 0c85925
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const activeProxies: { [key: string]: PortProxy } = {}
registerCleanupFunction("kill-service-port-proxies", () => {
for (const proxy of Object.values(activeProxies)) {
try {
// Avoid EPIPE errors
proxy.server.on("error", () => {})
stopPortProxy(proxy)
} catch {}
}
Expand Down Expand Up @@ -290,9 +292,6 @@ function stopPortProxy(proxy: PortProxy, log?: LogEntry) {
delete activeProxies[proxy.key]

try {
// Avoid EPIPE errors
proxy.server.on("error", () => {})

proxy.server.close()
} catch {}
}
Expand Down

0 comments on commit 0c85925

Please sign in to comment.