diff --git a/splitio/proxy/conf/sections.go b/splitio/proxy/conf/sections.go index 2b9fccd6..4c713253 100644 --- a/splitio/proxy/conf/sections.go +++ b/splitio/proxy/conf/sections.go @@ -21,7 +21,7 @@ type Main struct { Healthcheck Healthcheck `json:"healthcheck" s-nested:"true"` Observability Observability `json:"observability" s-nested:"true"` FlagSpecVersion string `json:"flagSpecVersion" s-cli:"flag-spec-version" s-def:"1.2" s-desc:"Spec version for flags"` - LargeSegmentVersion string `json:"largeSegmentVersion" s-cli:"large-segment-version" s-def:"1.0" s-desc:"Spec version for large segments"` + LargeSegmentVersion string `json:"largeSegmentVersion" s-cli:"largesegment-version" s-def:"1.0" s-desc:"Spec version for large segments"` } // BuildAdvancedConfig generates a commons-compatible advancedconfig with default + overriden parameters @@ -33,6 +33,7 @@ func (m *Main) BuildAdvancedConfig() *cconf.AdvancedConfig { tmp.StreamingEnabled = m.Sync.Advanced.StreamingEnabled tmp.SplitsRefreshRate = int(m.Sync.SplitRefreshRateMs / 1000) tmp.SegmentsRefreshRate = int(m.Sync.SegmentRefreshRateMs / 1000) + tmp.LargeSegment.LazyLoad = m.Sync.Advanced.LargeSegmentLazyLoad return tmp } @@ -71,7 +72,7 @@ type Persistent struct { type Sync struct { SplitRefreshRateMs int64 `json:"splitRefreshRateMs" s-cli:"split-refresh-rate-ms" s-def:"60000" s-desc:"How often to refresh feature flags"` SegmentRefreshRateMs int64 `json:"segmentRefreshRateMs" s-cli:"segment-refresh-rate-ms" s-def:"60000" s-desc:"How often to refresh segments"` - LargeSegmentRefreshRateMs int64 `json:"largeSegmentRefreshRateMs" s-cli:"large-segment-refresh-rate-ms" s-def:"3600000" s-desc:"How often to refresh large segments"` + LargeSegmentRefreshRateMs int64 `json:"largeSegmentRefreshRateMs" s-cli:"largesegment-refresh-rate-ms" s-def:"3600000" s-desc:"How often to refresh large segments"` Advanced AdvancedSync `json:"advanced" s-nested:"true"` } @@ -86,6 +87,7 @@ type AdvancedSync struct { EventsWorkers int64 `json:"eventsWorkers" s-cli:"events-workers" s-def:"10" s-desc:"#workers to forward events to Split servers"` TelemetryWorkers int64 `json:"telemetryWorkers" s-cli:"telemetry-workers" s-def:"10" s-desc:"#workers to forward telemetry to Split servers"` InternalMetricsRateMs int64 `json:"internalTelemetryRateMs" s-cli:"internal-metrics-rate-ms" s-def:"3600000" s-desc:"How often to send internal metrics"` + LargeSegmentLazyLoad bool `json:"largeSegmentLazyLoad" s-cli:"largesegment-lazy-load" s-def:"false" s-desc:"On/Off Large Segment Lazy Load"` } // Healthcheck configuration options diff --git a/splitio/proxy/initialization.go b/splitio/proxy/initialization.go index 7b3f0efa..e97d01da 100644 --- a/splitio/proxy/initialization.go +++ b/splitio/proxy/initialization.go @@ -137,7 +137,7 @@ func Start(logger logging.LoggerInterface, cfg *pconf.Main) error { ImpressionSyncTask: impressionTask, ImpressionsCountSyncTask: impressionCountTask, EventSyncTask: eventsTask, - LargeSegmentSyncTask: tasks.NewFetchLargeSegmentsTask(workers.LargeSegmentUpdater, splitStorage, int(cfg.Sync.LargeSegmentRefreshRateMs/1000), advanced.SegmentWorkers, 100, logger), + LargeSegmentSyncTask: tasks.NewFetchLargeSegmentsTask(workers.LargeSegmentUpdater, splitStorage, int(cfg.Sync.LargeSegmentRefreshRateMs/1000), advanced.LargeSegment.Workers, advanced.LargeSegment.QueueSize, logger), } // Creating Synchronizer for tasks