Skip to content

Commit

Permalink
#999 Get adhocReqChan buffer from config (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanchavan1918 authored Oct 8, 2024
1 parent 37ffaaf commit 32c0941
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type Config struct {
EnableMultiThreading bool `mapstructure:"enablemultithreading"`
StoreMapInitSize int `mapstructure:"storemapinitsize"`
WatchChanBufSize int `mapstructure:"watchchanbufsize"`
AdhocReqChanBufSize int `mapstructure:"adhocreqchanbufsize"`
} `mapstructure:"server"`
Auth struct {
UserName string `mapstructure:"username"`
Expand Down Expand Up @@ -106,6 +107,7 @@ var baseConfig = Config{
EnableMultiThreading bool `mapstructure:"enablemultithreading"`
StoreMapInitSize int `mapstructure:"storemapinitsize"`
WatchChanBufSize int `mapstructure:"watchchanbufsize"`
AdhocReqChanBufSize int `mapstructure:"adhocreqchanbufsize"`
}{
Addr: DefaultHost,
Port: DefaultPort,
Expand All @@ -127,6 +129,7 @@ var baseConfig = Config{
EnableMultiThreading: false,
StoreMapInitSize: 1024000,
WatchChanBufSize: 20000,
AdhocReqChanBufSize: 20, // assuming we wouldn't have more than 20 adhoc requests being sent at a time.
},
Auth: struct {
UserName string `mapstructure:"username"`
Expand Down
1 change: 1 addition & 0 deletions dice.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PrettyPrintLogs = false
EnableMultiThreading = false
StoreMapInitSize = 10240
WatchChanBufSize = 20000
AdhocReqChanBufSize = 20

[Auth]
UserName = 'dice'
Expand Down
2 changes: 1 addition & 1 deletion internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewWorker(wid string, respChan chan *ops.StoreResponse,
respChan: respChan,
logger: logger,
Session: auth.NewSession(),
adhocReqChan: make(chan *cmd.DiceDBCmd, 20), // assuming we wouldn't have more than 20 adhoc requests being sent at a time.
adhocReqChan: make(chan *cmd.DiceDBCmd, config.DiceConfig.Server.AdhocReqChanBufSize),
}
}

Expand Down

0 comments on commit 32c0941

Please sign in to comment.