Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sticky context exclude node #198

Open
wants to merge 12 commits into
base: dev-v19
Choose a base branch
from
Prev Previous commit
Next Next commit
add StickyContextExcludeNode
Signed-off-by: s.klimov <s.klimov@ankr.com>
  • Loading branch information
klimov-ankr committed May 25, 2024
commit 2ef977707049951028df196969a3456b6e9b6a9d
4 changes: 2 additions & 2 deletions liteclient/pool.go
Original file line number Diff line number Diff line change
@@ -210,14 +210,14 @@ func (c *ConnectionPool) QueryADNL(ctx context.Context, request tl.Serializable,
tm := time.Now()

var node *connection
nodeIDs, _ := ctx.Value(_StickyCtxUsedNodesKey).([]uint32)
excludeNodes, _ := ctx.Value(_StickyCtxUsedNodesKey).([]uint32)
if nodeID, ok := ctx.Value(_StickyCtxKey).(uint32); ok && nodeID > 0 {
node, err = c.querySticky(nodeID, req)
if err != nil {
return err
}
} else {
node, err = c.queryWithSmartBalancer(nodeIDs, req)
node, err = c.queryWithSmartBalancer(excludeNodes, req)
if err != nil {
return err
}