Skip to content

Syncs the instance settings cache when settings are updated#2189

Open
seb-kw wants to merge 1 commit into
mainfrom
fix/set-instance-settings
Open

Syncs the instance settings cache when settings are updated#2189
seb-kw wants to merge 1 commit into
mainfrom
fix/set-instance-settings

Conversation

@seb-kw

@seb-kw seb-kw commented Jun 24, 2026

Copy link
Copy Markdown
Member

No description provided.

…tale response is avoided

Signed-off-by: Sebastian Kawelke <sebastian.kawelke@l3montree.com>
Copilot AI review requested due to automatic review settings June 24, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ConfigService.SetJSONConfig to keep the in-memory instanceSettings cache aligned with configuration updates written to the database, reducing the window where API/middleware reads may observe stale settings.

Changes:

  • Change SetJSONConfig to return early on repository save error instead of returning the repository call directly.
  • Add logic to refresh the in-memory instanceSettings cache + expiry after successfully saving the instanceSettings config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +58
// 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
instanceSettingsExpiry = time.Now().Add(5 * time.Minute)
}
}
Comment on lines +53 to +55
if key == "instanceSettings" && instanceSettingsCache != nil {
if settings, ok := v.(shared.InstanceSettings); ok {
instanceSettingsCache = &settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants