mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
added PRINT STATS to config
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user