From 3a05eb6fb47f9cc46ff30f8dbf691635d4cf9bf4 Mon Sep 17 00:00:00 2001 From: dlut_xz <52518280+fcgxz2003@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:35:46 +0800 Subject: [PATCH] fix: comments in neighbours function (#3069) Signed-off-by: fcgxz2003 <834756128@qq.com> Signed-off-by: XZ <834756128@qq.com> --- scheduler/networktopology/network_topology.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scheduler/networktopology/network_topology.go b/scheduler/networktopology/network_topology.go index d375fcc1aeb..c9b258313ec 100644 --- a/scheduler/networktopology/network_topology.go +++ b/scheduler/networktopology/network_topology.go @@ -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) @@ -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 {