summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 7becddff4..80d982e5e 100644
--- a/model/config.go
+++ b/model/config.go
@@ -140,6 +140,7 @@ const (
ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS = 365
ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME = "03:00"
ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX = ""
+ ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE = 1
DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS = 365
DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS = 365
@@ -487,6 +488,7 @@ type ElasticsearchSettings struct {
AggregatePostsAfterDays *int
PostsAggregatorJobStartTime *string
IndexPrefix *string
+ LiveIndexingBatchSize *int
}
type DataRetentionSettings struct {
@@ -1584,6 +1586,11 @@ func (o *Config) SetDefaults() {
*o.ElasticsearchSettings.IndexPrefix = ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX
}
+ if o.ElasticsearchSettings.LiveIndexingBatchSize == nil {
+ o.ElasticsearchSettings.LiveIndexingBatchSize = new(int)
+ *o.ElasticsearchSettings.LiveIndexingBatchSize = ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE
+ }
+
if o.DataRetentionSettings.EnableMessageDeletion == nil {
o.DataRetentionSettings.EnableMessageDeletion = new(bool)
*o.DataRetentionSettings.EnableMessageDeletion = false
@@ -1969,6 +1976,10 @@ func (ess *ElasticsearchSettings) isValid() *AppError {
return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.posts_aggregator_job_start_time.app_error", nil, err.Error(), http.StatusBadRequest)
}
+ if *ess.LiveIndexingBatchSize < 1 {
+ return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.live_indexing_batch_size.app_error", nil, "", http.StatusBadRequest)
+ }
+
return nil
}