frostfs-node/pkg/services/object/search/remote.go
Leonard Lyubich adbbad0beb [#607] network: Do not work with Address pointers
`network.Address` structure in most cases created once and used read-only.

Replace `AddressFromString` function with `Address.FromString` method with
the same purpose and implementation. Make all libraries to work with value.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-18 18:09:50 +03:00

31 lines
522 B
Go

package searchsvc
import (
"context"
"github.com/nspcc-dev/neofs-node/pkg/network"
"go.uber.org/zap"
)
func (exec *execCtx) processNode(ctx context.Context, addr network.Address) {
log := exec.log.With(zap.Stringer("remote node", addr))
log.Debug("processing node...")
client, ok := exec.remoteClient(addr)
if !ok {
return
}
ids, err := client.searchObjects(exec)
if err != nil {
exec.log.Debug("local operation failed",
zap.String("error", err.Error()),
)
return
}
exec.writeIDList(ids)
}