Skip to content
Open
Changes from all commits
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
14 changes: 13 additions & 1 deletion services/config_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ func (service ConfigService) SetJSONConfig(ctx context.Context, key string, v an
Val: string(b),
}

return service.repository.Save(ctx, nil, &config)
if err := service.repository.Save(ctx, nil, &config); err != nil {
return err
}

// Keep the in-memory instance settings cache in sync with the DB write
if key == "instanceSettings" && instanceSettingsCache != nil {
if settings, ok := v.(shared.InstanceSettings); ok {
instanceSettingsCache = &settings
Comment on lines +53 to +55
instanceSettingsExpiry = time.Now().Add(5 * time.Minute)
}
}
Comment on lines +52 to +58

return nil
}

func (service ConfigService) RemoveConfig(ctx context.Context, key string) error {
Expand Down
Loading