added PRINT STATS to config

This commit is contained in:
pippellia-btc
2025-06-16 16:00:40 +02:00
parent 3c01393118
commit 222d6f6b78

View File

@@ -22,6 +22,7 @@ type SystemConfig struct {
PubkeysCapacity int PubkeysCapacity int
InitPubkeys []string // only used during initialization InitPubkeys []string // only used during initialization
PrintStats bool
} }
func NewSystemConfig() SystemConfig { func NewSystemConfig() SystemConfig {
@@ -40,6 +41,7 @@ func (c SystemConfig) Print() {
fmt.Printf(" EventsCapacity: %d\n", c.EventsCapacity) fmt.Printf(" EventsCapacity: %d\n", c.EventsCapacity)
fmt.Printf(" PubkeysCapacity: %d\n", c.PubkeysCapacity) fmt.Printf(" PubkeysCapacity: %d\n", c.PubkeysCapacity)
fmt.Printf(" InitPubkeys: %v\n", c.InitPubkeys) fmt.Printf(" InitPubkeys: %v\n", c.InitPubkeys)
fmt.Printf(" PrintStats: %v\n", c.PrintStats)
} }
// The configuration parameters for the system and the main processes // The configuration parameters for the system and the main processes
@@ -108,6 +110,12 @@ func Load() (*Config, error) {
config.InitPubkeys = pubkeys config.InitPubkeys = pubkeys
case "PRINT_STATS":
config.PrintStats, err = strconv.ParseBool(val)
if err != nil {
return nil, fmt.Errorf("error parsing %v: %v", keyVal, err)
}
case "FIREHOSE_OFFSET": case "FIREHOSE_OFFSET":
offset, err := strconv.Atoi(val) offset, err := strconv.Atoi(val)
if err != nil { if err != nil {