Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle consolidated configuration change event #66

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions providers/flagd/pkg/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,17 +480,19 @@ func (p *Provider) handleConfigurationChangeEvent(ctx context.Context, event *sc
return errors.New("no data in event")
}

flagKeyVal, ok := event.Data.AsMap()["flagKey"]
flagsVal, ok := event.Data.AsMap()["flags"]
if !ok {
return errors.New("no flagKey field in event data")
return errors.New("no flags field in event data")
}

flagKey, ok := flagKeyVal.(string)
flags, ok := flagsVal.(map[string]interface{})
if !ok {
return errors.New("flagKey is not a string")
return errors.New("flags isn't a map")
}

p.cache.Remove(flagKey)
for flagKey, _ := range flags {
p.cache.Remove(flagKey)
}

return nil
}