Skip to content

Commit

Permalink
adding scanCount config
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzmauro committed Jan 9, 2024
1 parent d3dd94c commit 26aec81
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
github.com/splitio/gincache v1.0.1
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec
github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.6
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ github.com/splitio/gincache v1.0.1 h1:dLYdANY/BqH4KcUMCe/LluLyV5WtuE/LEdQWRE06IX
github.com/splitio/gincache v1.0.1/go.mod h1:CcgJDSM9Af75kyBH0724v55URVwMBuSj5x1eCWIOECY=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155 h1:SecApJYs4oumtZMIBwnE2DFyImlwiuswXIdZDaW42uE=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240108145819-63cfece95155/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109140227-821edb4de9f5 h1:KVx3rhvvBc5aWKuWsvaxxHQAp//q+TmzH/Sdp70sULI=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109140227-821edb4de9f5/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec h1:fNlBnkJyOFJ13IUFCreLL0h1sj7bK6m8IkJGV64LXFk=
github.com/splitio/go-split-commons/v5 v5.1.2-0.20240109143938-74c6638a98ec/go.mod h1:sdXeIX4UdBf+EPdVAdBC+f2RuFUh/44bqHlTLy3rH/I=
github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788 h1:URrg0BcgUzFE4pAacFlrWiTrmEdH4SY03XXLLWVtqLc=
github.com/splitio/go-toolkit/v5 v5.3.3-0.20240108144147-a36a17c46788/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
1 change: 1 addition & 0 deletions splitio/producer/conf/sections.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Redis struct {
TLSSkipNameValidation bool `json:"tlsSkipNameValidation" s-cli:"redis-tls-skip-name-validation" s-def:"false" s-desc:"Blindly accept server's public key."`
TLSClientCertificate string `json:"tlsClientCertificate" s-cli:"redis-tls-client-certificate" s-def:"" s-desc:"Client certificate signed by a known CA"`
TLSClientKey string `json:"tlsClientKey" s-cli:"redis-tls-client-key" s-def:"" s-desc:"Client private key matching the certificate."`
ScanCount int `json:"scanCount" s-cli:"redis-scan-count" s-def:"10" s-desc:"It is the number of keys to search through at a time per cursor iteration, we use it to read feature flag names and flag set names."`
}

// Healthcheck configuration options
Expand Down
2 changes: 1 addition & 1 deletion splitio/producer/initialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func Start(logger logging.LoggerInterface, cfg *conf.Main) error {
flagSetsFilter := flagsets.NewFlagSetFilter(cfg.FlagSetsFilter)

// These storages are forwarded to the dashboard, the sdk-telemetry is irrelevant there
splitStorage, err := observability.NewObservableSplitStorage(redis.NewSplitStorage(redisClient, logger, flagSetsFilter), logger)
splitStorage, err := observability.NewObservableSplitStorage(redis.NewSplitStorage(redisClient, logger, flagSetsFilter, int64(redisOptions.ScanCount)), logger)
if err != nil {
return fmt.Errorf("error instantiating observable feature flag storage: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions splitio/producer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func parseRedisOptions(cfg *conf.Redis) (*config.RedisConfig, error) {
WriteTimeout: cfg.WriteTimeout,
PoolSize: cfg.PoolSize,
TLSConfig: tlsCfg,
ScanCount: cfg.ScanCount,
}

if cfg.SentinelReplication {
Expand Down

0 comments on commit 26aec81

Please sign in to comment.