summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-12-22 15:00:05 -0500
committerenahum <nahumhbl@gmail.com>2016-12-22 17:00:05 -0300
commita793eb865151b27f10fd8ff743e229535cc63865 (patch)
tree01137bd5c7e0b030cd5b80e8c31071b554a5d855 /model
parent768fe6bec344cf4154a39767000c04ce1a5b5a71 (diff)
downloadchat-a793eb865151b27f10fd8ff743e229535cc63865.tar.gz
chat-a793eb865151b27f10fd8ff743e229535cc63865.tar.bz2
chat-a793eb865151b27f10fd8ff743e229535cc63865.zip
Skip intensive stat DB queries when more than a set number of users on the system (#4876)
Diffstat (limited to 'model')
-rw-r--r--model/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index c28e02e18..1ac44c579 100644
--- a/model/config.go
+++ b/model/config.go
@@ -105,6 +105,10 @@ type MetricsSettings struct {
ListenAddress *string
}
+type AnalyticsSettings struct {
+ MaxUsersForStatistics *int
+}
+
type SSOSettings struct {
Enable bool
Secret string
@@ -345,6 +349,7 @@ type Config struct {
NativeAppSettings NativeAppSettings
ClusterSettings ClusterSettings
MetricsSettings MetricsSettings
+ AnalyticsSettings AnalyticsSettings
WebrtcSettings WebrtcSettings
}
@@ -845,6 +850,11 @@ func (o *Config) SetDefaults() {
*o.MetricsSettings.Enable = false
}
+ if o.AnalyticsSettings.MaxUsersForStatistics == nil {
+ o.AnalyticsSettings.MaxUsersForStatistics = new(int)
+ *o.AnalyticsSettings.MaxUsersForStatistics = 2500
+ }
+
if o.ComplianceSettings.Enable == nil {
o.ComplianceSettings.Enable = new(bool)
*o.ComplianceSettings.Enable = false