From 0ae418b43cdbcd02fc3ca9bde0a3bee305b039d9 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 15:07:01 +0100 Subject: [PATCH] =?UTF-8?q?mesh-watcher=20names=20the=20self-check=20seat?= =?UTF-8?q?=20and=20its=20event=20from=20the=20seat's=20contract=20(B5d;?= =?UTF-8?q?=20ADR=200634=20=C2=A71;=20issue=201966)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- modules/mesh-watcher/cmd/mesh-watcher/heartbeat.go | 6 +++--- modules/mesh-watcher/cmd/mesh-watcher/main.go | 4 ++-- modules/mesh-watcher/go.mod | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/mesh-watcher/cmd/mesh-watcher/heartbeat.go b/modules/mesh-watcher/cmd/mesh-watcher/heartbeat.go index e34c4cbfd..2fdbb7a89 100644 --- a/modules/mesh-watcher/cmd/mesh-watcher/heartbeat.go +++ b/modules/mesh-watcher/cmd/mesh-watcher/heartbeat.go @@ -24,11 +24,11 @@ import ( "strings" "time" - "git.novox.be/novox/mesh-sdk/go/health" + meshselfcheck "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshselfcheck" ) // HeartbeatEvent is the event's local name under the seat mesh-self-check. -const HeartbeatEvent = health.EventChecked +const HeartbeatEvent = meshselfcheck.EventChecked // Beat is one heartbeat. type Beat struct { @@ -39,7 +39,7 @@ type Beat struct { } // isHeartbeat says whether an envelope's key is the self-check's heartbeat. -func isHeartbeat(key string) bool { return key == health.SelfCheckModule+"."+HeartbeatEvent } +func isHeartbeat(key string) bool { return key == meshselfcheck.Seat+"."+HeartbeatEvent } // DecodeBeat reads one heartbeat's body. func DecodeBeat(body []byte) (Beat, error) { diff --git a/modules/mesh-watcher/cmd/mesh-watcher/main.go b/modules/mesh-watcher/cmd/mesh-watcher/main.go index 79b516bcb..41e57b7c6 100644 --- a/modules/mesh-watcher/cmd/mesh-watcher/main.go +++ b/modules/mesh-watcher/cmd/mesh-watcher/main.go @@ -17,9 +17,9 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" + meshselfcheck "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshselfcheck" stdio "git.novox.be/novox/mesh-sdk/go" "git.novox.be/novox/mesh-sdk/go/delivery" - "git.novox.be/novox/mesh-sdk/go/health" "git.novox.be/novox/mesh-sdk/go/views" ) @@ -121,7 +121,7 @@ func run(w *Watcher, l *listening, node string, placement *views.Reader) { } <-stdio.Served() // subscribed as soon as the runtime serves, never after a guessed wait: a heartbeat sent meanwhile is heard for wait := 2 * time.Second; ; wait = min(wait*2, time.Minute) { - err := stdio.Subscribe(health.SelfCheckModule+".*", handle) + err := stdio.Subscribe(meshselfcheck.Seat+".*", handle) if err == nil { l.set("listening") logf("[mesh-watcher] listening for the self-check's heartbeat; watching from %s", node) diff --git a/modules/mesh-watcher/go.mod b/modules/mesh-watcher/go.mod index cf36fac8e..e578d0d55 100644 --- a/modules/mesh-watcher/go.mod +++ b/modules/mesh-watcher/go.mod @@ -15,3 +15,5 @@ require ( golang.org/x/crypto v0.57.0 // indirect golang.org/x/sys v0.48.0 // indirect ) + +require git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshselfcheck v0.0.0-00010101000000-000000000000