Skip to content

Commit f36728f

Browse files
author
christopher.a.fickess
committed
Create modular ui read real time config in system console
1 parent 04a6cd7 commit f36728f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

server/configuration.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ func parseAndValidateMaxThreadCountMoveSize(s string) (int, error) {
104104
return maxCount, nil
105105
}
106106

107-
// getConfiguration retrieves the active configuration under lock, making it safe to use
108-
// concurrently. The active configuration may change underneath the client of this method, but
109-
// the struct returned by this API call is considered immutable.
107+
// getConfiguration reads the active plugin configuration live from the Mattermost config store
108+
// on every call. This ensures changes applied via mmctl config patch or any external config write
109+
// are reflected immediately without requiring a plugin restart or disable/enable cycle.
110110
func (p *Plugin) getConfiguration() *configuration {
111-
p.configurationLock.RLock()
112-
defer p.configurationLock.RUnlock()
111+
var config = new(configuration)
113112

114-
if p.configuration == nil {
113+
if err := p.API.LoadPluginConfiguration(config); err != nil {
114+
p.API.LogError("Failed to load plugin configuration", "error", err.Error())
115115
return &configuration{}
116116
}
117117

118-
return p.configuration
118+
return config
119119
}
120120

121121
// setConfiguration replaces the active configuration under lock.

0 commit comments

Comments
 (0)