Skip to content

Commit 2af77da

Browse files
committed
simplified proxy error handling via channel
1 parent 672d8c9 commit 2af77da

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/orchestrator/main.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"flag"
77
"fmt"
8-
"github.com/e2b-dev/infra/packages/orchestrator/internal/proxy"
98
"log"
109
"os"
1110
"os/signal"
@@ -18,6 +17,7 @@ import (
1817
"go.uber.org/zap/zapcore"
1918

2019
"github.com/e2b-dev/infra/packages/orchestrator/internal/consul"
20+
"github.com/e2b-dev/infra/packages/orchestrator/internal/proxy"
2121
"github.com/e2b-dev/infra/packages/orchestrator/internal/server"
2222
"github.com/e2b-dev/infra/packages/shared/pkg/env"
2323
"github.com/e2b-dev/infra/packages/shared/pkg/logger"
@@ -161,13 +161,12 @@ func main() {
161161

162162
errChan := make(chan error, 1)
163163
go func() {
164-
err := sessionProxy.Start()
165-
errChan <- err
164+
errChan <- sessionProxy.Start()
166165
}()
167166

168167
select {
169168
case <-ctx.Done():
170-
case <-errChan:
169+
case err = <-errChan:
171170
if err != nil {
172171
zap.L().Error("session proxy failed", zap.Error(err))
173172
exitCode.Add(1)

0 commit comments

Comments
 (0)