Fix connect timeout

non-blocking
Jack Christensen 2022-06-04 08:38:57 -05:00
parent ca22396789
commit ea3cdab234
1 changed files with 1 additions and 0 deletions

View File

@ -251,6 +251,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig
pgConn.conn = nbbconn.New(pgConn.conn)
pgConn.contextWatcher.Unwatch() // context watcher should watch nbbconn
pgConn.contextWatcher = newContextWatcher(pgConn.conn)
pgConn.contextWatcher.Watch(ctx)
defer pgConn.contextWatcher.Unwatch()