diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index a2878df6f..307d52c55 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1191,6 +1191,7 @@ func (c *Client4) DatabaseRecycle() (bool, *Response) { } } +// InvalidateCaches will purge the cache and can affect the performance while is cleaning. func (c *Client4) InvalidateCaches() (bool, *Response) { if r, err := c.DoApiPost(c.GetCacheRoute()+"/invalidate", ""); err != nil { return false, &Response{StatusCode: r.StatusCode, Error: err} @@ -1200,6 +1201,16 @@ func (c *Client4) InvalidateCaches() (bool, *Response) { } } +// UpdateConfig will update the server configuration +func (c *Client4) UpdateConfig(config *Config) (*Config, *Response) { + if r, err := c.DoApiPut(c.GetConfigRoute(), config.ToJson()); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return ConfigFromJson(r.Body), BuildResponse(r) + } +} + // Webhooks Section // CreateIncomingWebhook creates an incoming webhook for a channel. |