once使用封装的leader和heartbeat

This commit is contained in:
Yun
2025-09-24 17:26:33 +08:00
parent 0c4e92f164
commit 85d041753e
7 changed files with 844 additions and 187 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ func defaultOptions() Options {
usePriority: false,
priorityVal: 0,
batchSize: 100,
maxRetryCount: 100,
maxRetryCount: 0,
}
}
@@ -78,8 +78,8 @@ func WithBatchSize(size int) Option {
func WithMaxRetryCount(count int) Option {
return func(o *Options) {
if count <= 0 {
count = 1
if count < 0 {
count = 0
}
o.maxRetryCount = count
}