Skip to content

Commit e856439

Browse files
committed
fix: lint
1 parent 57b82c0 commit e856439

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/zcache/local_cache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ func (c *localCache) Set(_ context.Context, key string, value interface{}, ttl t
9292
c.logger.Debugf("set key on local cache with TTL, key: [%s], value: [%v], ttl: [%v]", realKey, value, ttl)
9393

9494
// Convert time.Duration to seconds for Ristretto
95-
var ttlSeconds time.Duration
95+
var ttlSeconds int64
9696
if ttl == neverExpires {
9797
ttlSeconds = 0 // 0 means never expire in Ristretto
9898
} else {
99-
ttlSeconds = ttl // Use the provided TTL
99+
ttlSeconds = int64(ttl) // Use the provided TTL
100100
}
101101

102-
if !c.client.SetWithTTL(realKey, itemBytes, cacheCost, ttlSeconds) {
102+
if !c.client.SetWithTTL(realKey, itemBytes, cacheCost, time.Duration(ttlSeconds)) {
103103
c.logger.Errorf("error setting new key on local cache, fullKey: [%s]", realKey)
104104
return errors.New("failed to set key with TTL")
105105
}

0 commit comments

Comments
 (0)