Increase keepalive timeout. Add reconnection delay.

This commit is contained in:
Jay
2026-04-23 21:26:40 -04:00
parent 0ac8d9facd
commit 7e7b18bb2a
3 changed files with 34 additions and 9 deletions
+12 -8
View File
@@ -93,14 +93,15 @@ func (w *DefaultWorker) Start(pool PoolPlugin) {
go func() {
defer wg.Done()
session := &Session{
id: w.id,
connPtr: &w.conn,
messages: toQueue,
heartbeat: w.heartbeat,
dial: dial,
keepalive: keepalive,
newConn: newConn,
logger: w.logger,
id: w.id,
connPtr: &w.conn,
messages: toQueue,
heartbeat: w.heartbeat,
dial: dial,
keepalive: keepalive,
newConn: newConn,
reconnectDelay: w.config.ReconnectDelay,
logger: w.logger,
}
session.Start(w.ctx, pool)
}()
@@ -153,6 +154,8 @@ type Session struct {
keepalive <-chan struct{}
newConn <-chan *transport.Connection
reconnectDelay time.Duration
logger *slog.Logger
}
@@ -238,6 +241,7 @@ func (s *Session) Start(
}
// refresh session
time.Sleep(s.reconnectDelay)
}
}