feat(kol): cache marketplace and generation reads with singleflight
Add cache-aside + singleflight to KOL marketplace list/detail, my-subscription prompts, and generation schema lookups. Invalidate the shared public-facing caches when subscriptions are added/revoked (ops) or KOL profile is updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ type kolAssistStreamEvent struct {
|
||||
}
|
||||
|
||||
func NewKolManageHandler(a *bootstrap.App, assets *AssetHandler) *KolManageHandler {
|
||||
profileSvc := app.NewKolProfileService(a.KolProfiles).WithObjectStorage(a.ObjectStorage)
|
||||
profileSvc := app.NewKolProfileService(a.KolProfiles).WithObjectStorage(a.ObjectStorage).WithCache(a.Cache)
|
||||
|
||||
return &KolManageHandler{
|
||||
profileSvc: profileSvc,
|
||||
|
||||
@@ -18,7 +18,7 @@ type KolMarketplaceHandler struct {
|
||||
|
||||
func NewKolMarketplaceHandler(a *bootstrap.App) *KolMarketplaceHandler {
|
||||
return &KolMarketplaceHandler{
|
||||
svc: app.NewKolMarketplaceService(a.KolMarketplace, a.KolSubscriptions),
|
||||
svc: app.NewKolMarketplaceService(a.KolMarketplace, a.KolSubscriptions).WithCache(a.Cache),
|
||||
genSvc: app.NewKolGenerationService(
|
||||
a.DB,
|
||||
a.KolSubscriptions,
|
||||
|
||||
Reference in New Issue
Block a user