feat(cache,worker): overhaul cache layer and add generation task lease recovery
- shared/cache: add Options/L1/async/metrics/prefix decorators, multi-key ops, Redis pool tuning, and JSON readthrough metrics - worker-generate: claim tasks via DB lease + heartbeat, requeue stale queued tasks, expire dead leases with refund/cache invalidation - tenant: version article cache keys so worker recovery invalidations propagate cleanly - shared/config: expand Redis (pool/timeouts/TLS) and Generation (lease/recovery) configs with defaults Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,8 +20,17 @@ func NewClient(ctx context.Context, cfg config.RedisConfig) (*goredis.Client, er
|
||||
|
||||
func NewLazyClient(cfg config.RedisConfig) *goredis.Client {
|
||||
client := goredis.NewClient(&goredis.Options{
|
||||
Addr: cfg.Addr,
|
||||
DB: cfg.DB,
|
||||
Addr: cfg.Addr,
|
||||
Password: cfg.Password,
|
||||
DB: cfg.DB,
|
||||
DialTimeout: cfg.DialTimeout,
|
||||
ReadTimeout: cfg.ReadTimeout,
|
||||
WriteTimeout: cfg.WriteTimeout,
|
||||
PoolSize: cfg.PoolSize,
|
||||
MinIdleConns: cfg.MinIdleConns,
|
||||
MaxRetries: cfg.MaxRetries,
|
||||
PoolTimeout: cfg.PoolTimeout,
|
||||
TLSConfig: cfg.TLSConfig(),
|
||||
})
|
||||
return client
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user