mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
perf(config): add Otter RAM cache layer for system configs
Introduce pkg/cache/ram on top of existing Redis/DB config reads. GetByKey now checks local RAM before Redis. Unified invalidation clears RAM and Redis hash fields on admin writes, with pub/sub for multi-node RAM eviction. Add tests and wire create/update/migrator write paths.
This commit is contained in:
Vendored
+1
-5
@@ -129,9 +129,5 @@ func saveOrUpdateConfig(ctx context.Context, key string, value string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Sync config value in Redis cache
|
||||
if db.Redis != nil {
|
||||
_ = db.HSetJSON(ctx, model.SystemConfigRedisHashKey, key, &sc)
|
||||
}
|
||||
return nil
|
||||
return model.InvalidateSystemConfigCache(ctx, key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user