From 84569dc2902b9e351e67d7deda5805028f63721f Mon Sep 17 00:00:00 2001 From: Yun Date: Wed, 24 Sep 2025 17:29:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- heartbeat/heartbeat.go | 1 + leader/leader.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/heartbeat/heartbeat.go b/heartbeat/heartbeat.go index dfb2c42..f478f69 100644 --- a/heartbeat/heartbeat.go +++ b/heartbeat/heartbeat.go @@ -15,6 +15,7 @@ import ( // 心跳 // 作用:上报实例存活状态 +// 依赖:leader priority type HeartBeat struct { ctx context.Context diff --git a/leader/leader.go b/leader/leader.go index 0e50cf4..cde8c3f 100644 --- a/leader/leader.go +++ b/leader/leader.go @@ -14,6 +14,10 @@ import ( "github.com/yuninks/timerx/priority" ) +// 领导 +// 作用:领导选举,是领导才执行,避免资源浪费 +// 依赖:priority + type Leader struct { ctx context.Context cancel context.CancelFunc