implement redis key ttl
This commit is contained in:
parent
21a4165489
commit
ac000112c3
@ -45,6 +45,7 @@ func (r *RedisRecorder) Ping(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *RedisRecorder) Init(ctx context.Context, opts *recorders.RecorderOpts) {
|
func (r *RedisRecorder) Init(ctx context.Context, opts *recorders.RecorderOpts) {
|
||||||
|
r.baseCtx = opts.BaseCtx
|
||||||
r.log = zerolog.Ctx(r.baseCtx)
|
r.log = zerolog.Ctx(r.baseCtx)
|
||||||
|
|
||||||
if opts.AppConfig.RecorderConfig.RedisConfig == nil {
|
if opts.AppConfig.RecorderConfig.RedisConfig == nil {
|
||||||
@ -58,7 +59,6 @@ func (r *RedisRecorder) Init(ctx context.Context, opts *recorders.RecorderOpts)
|
|||||||
r.config = opts.AppConfig
|
r.config = opts.AppConfig
|
||||||
r.keep = opts.RetainLast
|
r.keep = opts.RetainLast
|
||||||
r.RWMutex = &sync.RWMutex{}
|
r.RWMutex = &sync.RWMutex{}
|
||||||
r.baseCtx = opts.BaseCtx
|
|
||||||
|
|
||||||
keyTTL := opts.AppConfig.RecorderConfig.RedisConfig.RedisKeyTTL
|
keyTTL := opts.AppConfig.RecorderConfig.RedisConfig.RedisKeyTTL
|
||||||
if keyTTL == "" {
|
if keyTTL == "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user