处理Leader的key为空问题
This commit is contained in:
+3
-3
@@ -9,8 +9,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/google/uuid"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/yuninks/cachex"
|
||||
"github.com/yuninks/lockx"
|
||||
"github.com/yuninks/timerx/heartbeat"
|
||||
@@ -94,7 +94,7 @@ func InitCluster(ctx context.Context, red redis.UniversalClient, keyPrefix strin
|
||||
pri, err := priority.InitPriority(
|
||||
ctx,
|
||||
red,
|
||||
clu.priorityKey,
|
||||
clu.keyPrefix,
|
||||
op.priorityVal,
|
||||
priority.WithLogger(clu.logger),
|
||||
priority.WithInstanceId(clu.instanceId),
|
||||
@@ -111,7 +111,7 @@ func InitCluster(ctx context.Context, red redis.UniversalClient, keyPrefix strin
|
||||
le, err := leader.InitLeader(
|
||||
ctx,
|
||||
clu.redis,
|
||||
keyPrefix,
|
||||
clu.keyPrefix,
|
||||
leader.WithLogger(clu.logger),
|
||||
leader.WithPriority(clu.priority),
|
||||
leader.WithInstanceId(clu.instanceId),
|
||||
|
||||
@@ -53,6 +53,7 @@ func InitLeader(ctx context.Context, ref redis.UniversalClient, keyPrefix string
|
||||
cancel: cancel,
|
||||
redis: ref,
|
||||
leaderUniLockKey: "timer:leader_lockKey" + op.source + keyPrefix,
|
||||
leaderKey: "timer:leader" + op.source + keyPrefix,
|
||||
priority: op.priority,
|
||||
instanceId: op.instanceId,
|
||||
logger: op.logger,
|
||||
|
||||
Reference in New Issue
Block a user