@@ -31,6 +31,12 @@ type LogConfig struct {
3131 Description string `yaml:"description"`
3232}
3333
34+ type BufferSizes struct {
35+ Websocket int `yaml:"websocket"`
36+ CTLog int `yaml:"ctlog"`
37+ BroadcastManager int `yaml:"broadcastmanager"`
38+ }
39+
3440type Config struct {
3541 Webserver struct {
3642 ServerConfig `yaml:",inline"`
@@ -47,6 +53,7 @@ type Config struct {
4753 }
4854 General struct {
4955 AdditionalLogs []LogConfig `yaml:"additional_logs"`
56+ BufferSizes BufferSizes `yaml:"buffer_sizes"`
5057 DropOldLogs * bool `yaml:"drop_old_logs"`
5158 }
5259}
@@ -212,12 +219,23 @@ func validateConfig(config *Config) bool {
212219
213220 config .General .AdditionalLogs = validLogs
214221
215- // If the cleanup flag is not set, default to true
222+ if config .General .BufferSizes .Websocket <= 0 {
223+ config .General .BufferSizes .Websocket = 300
224+ }
225+
226+ if config .General .BufferSizes .CTLog <= 0 {
227+ config .General .BufferSizes .CTLog = 1000
228+ }
229+
230+ if config .General .BufferSizes .BroadcastManager <= 0 {
231+ config .General .BufferSizes .BroadcastManager = 10000
232+
233+ // If the cleanup flag is not set, default to true
216234 if config .General .DropOldLogs == nil {
217235 log .Println ("drop_old_logs is not set, defaulting to true" )
218236 defaultCleanup := true
219237 config .General .DropOldLogs = & defaultCleanup
220- }
238+ }
221239
222240 return true
223241}
0 commit comments