Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: comments in neighbours function #3069

Merged
merged 24 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scheduler/networktopology/network_topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ func (nt *networkTopology) ProbedCount(hostID string) (uint64, error) {
return probedCount, nil
}

// Neighbours gets the specified number neighbors of source host for aggregation, by regexp scaning cache
// (if it is not enough for code to work, access redis to get neighbors), then parsing keys and loading host,
// Neighbours gets the specified number neighbors of source host for aggregation by regexp scaning cache
// (if it is not enough for code to work, get neighbors from redis), then parsing keys and loading host,
// while updating the cache data.
func (nt *networkTopology) Neighbours(srcHost *resource.Host, n int) ([]*resource.Host, error) {
ctx, cancel := context.WithTimeout(context.Background(), contextTimeout)
Expand All @@ -340,7 +340,7 @@ func (nt *networkTopology) Neighbours(srcHost *resource.Host, n int) ([]*resourc
return nil, err
}

// If it is not enough for code to work, access redis to get neighbors.
// If it is not enough for code to work, get neighbors from redis.
if len(networkTopologyKeys) < n {
networkTopologyKeys, _, err = nt.rdb.Scan(ctx, 0, pkgredis.MakeNetworkTopologyKeyInScheduler(srcHost.ID, "*"), defaultScanCountLimit).Result()
if err != nil {
Expand Down
Loading