Skip to content

Commit 1b7c2ac

Browse files
fix: remove chi recursion router
현재 CPU, MEM 사용량이 지속적으로 증가하면서 Container가 재생성되는 상태가 지속됨 Pod Describe으로 확인 결과, API Mount 문제라고 판단되어, 문제가 되는 부분을 제거
1 parent dea6f62 commit 1b7c2ac

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

internal/app/run.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ import (
3333
"teleport-plugin-slack-access-request/internal/outbox/worker"
3434
"teleport-plugin-slack-access-request/internal/util/container"
3535

36-
"github.com/prometheus/client_golang/prometheus/promhttp"
37-
38-
_ "net/http/pprof"
39-
4036
"github.com/go-chi/chi/v5"
4137
"github.com/go-chi/chi/v5/middleware"
38+
"github.com/prometheus/client_golang/prometheus/promhttp"
4239
)
4340

4441
func Run() {
@@ -63,11 +60,6 @@ func Run() {
6360
errCh <- err
6461
}
6562
}()
66-
go func() {
67-
if err := http.ListenAndServe("localhost:6060", nil); err != nil {
68-
errCh <- err
69-
}
70-
}()
7163

7264
select {
7365
case <-ctx.Done():
@@ -152,8 +144,7 @@ func startAPIServer(ctx context.Context, router *chi.Mux, isReady *atomic.Value,
152144
slog.Info("starting outbox worker")
153145

154146
routers := NewRouter(db, clients, repos, services)
155-
serve := routers.Setup(router)
156-
router.Mount("/", serve)
147+
_ = routers.Setup(router)
157148
router.Handle("/metrics", promhttp.HandlerFor(metric.Registry, promhttp.HandlerOpts{}))
158149
isReady.Store(true)
159150
return nil

0 commit comments

Comments
 (0)