调整Key以支持Redis集群版

This commit is contained in:
Yun
2026-05-26 21:03:50 +08:00
parent f1e8a3e965
commit fa359b2b1a
9 changed files with 307 additions and 27 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package heartbeat
import (
"context"
"errors"
"fmt"
"strconv"
"sync"
"time"
@@ -47,7 +48,7 @@ func InitHeartBeat(ctx context.Context, ref redis.UniversalClient, keyPrefix str
ctx: ctx,
cancel: cancel,
heartbeatKey: "timer:heartbeat_key" + op.source + keyPrefix,
heartbeatKey: fmt.Sprintf("timer:{%s}:heartbeat_%s", keyPrefix, op.source),
priority: op.priority,
redis: ref,