diff --git a/chord/httpnode/server.go b/chord/httpnode/server.go index 64f7731..dd2767a 100644 --- a/chord/httpnode/server.go +++ b/chord/httpnode/server.go @@ -55,6 +55,7 @@ func (n *Node) Router() http.Handler { // Check performs checks that implement the Chord protocol. // It must be called periodically while the node is alive. func (n *Node) Check(ctx context.Context) error { + chord.CheckPredecessor(ctx, n.client, n.self) if err := chord.Stabilize(ctx, n.client, n.self); err != nil { return fmt.Errorf("failed to stabilize: %w", err) } @@ -62,7 +63,6 @@ func (n *Node) Check(ctx context.Context) error { // if err := chord.FixFingers(ctx, n.client, n.self); err != nil { // return fmt.Errorf("failed to fix fingers: %w", err) // } - chord.CheckPredecessor(ctx, n.client, n.self) return nil }