add keepalive option for tunnel entrypoint

This commit is contained in:
ginuerzh
2024-10-14 23:09:07 +08:00
parent 0ffed81601
commit 5bba004324
7 changed files with 251 additions and 140 deletions
+5 -5
View File
@@ -76,7 +76,6 @@ func (h *tunnelHandler) Init(md md.Metadata) (err error) {
h.log = h.options.Logger.WithFields(map[string]any{
"node": h.id,
})
h.pool = NewConnectorPool(h.id, h.md.sd)
h.ep = &entrypoint{
@@ -88,17 +87,18 @@ func (h *tunnelHandler) Init(md md.Metadata) (err error) {
log: h.log.WithFields(map[string]any{
"kind": "entrypoint",
}),
keepalive: h.md.entryPointKeepalive,
readTimeout: h.md.entryPointReadTimeout,
}
if err = h.initEntrypoint(); err != nil {
return
}
for _, ro := range h.options.Recorders {
if ro.Record == xrecorder.RecorderServiceHandler {
h.ep.recorder = ro
break
}
}
if err = h.initEntrypoint(); err != nil {
return
}
ctx, cancel := context.WithCancel(context.Background())
h.cancel = cancel