Plugins: Invalidate plugin context app settings cache post update (#63279)
invalid plugin settings
This commit is contained in:
@@ -106,7 +106,7 @@ func (p *Provider) pluginContext(ctx context.Context, pluginID string, user *use
|
||||
}
|
||||
|
||||
func (p *Provider) getCachedPluginSettings(ctx context.Context, pluginID string, user *user.SignedInUser) (*pluginsettings.DTO, error) {
|
||||
cacheKey := pluginSettingsCachePrefix + pluginID
|
||||
cacheKey := getCacheKey(pluginID)
|
||||
|
||||
if cached, found := p.cacheService.Get(cacheKey); found {
|
||||
ps := cached.(*pluginsettings.DTO)
|
||||
@@ -127,8 +127,16 @@ func (p *Provider) getCachedPluginSettings(ctx context.Context, pluginID string,
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
func (p *Provider) InvalidateSettingsCache(_ context.Context, pluginID string) {
|
||||
p.cacheService.Delete(getCacheKey(pluginID))
|
||||
}
|
||||
|
||||
func (p *Provider) decryptSecureJsonDataFn(ctx context.Context) func(ds *datasources.DataSource) (map[string]string, error) {
|
||||
return func(ds *datasources.DataSource) (map[string]string, error) {
|
||||
return p.dataSourceService.DecryptedValues(ctx, ds)
|
||||
}
|
||||
}
|
||||
|
||||
func getCacheKey(pluginID string) string {
|
||||
return pluginSettingsCachePrefix + pluginID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user