set stream parser throttle
This commit is contained in:
parent
d0779320e3
commit
ac5b8b8287
@ -82,6 +82,7 @@ type ServerConfig struct {
|
||||
StoreBackend string `ini:"store_backend"`
|
||||
Asn int `ini:"asn"`
|
||||
EnableNeighborsStatusRefresh bool `ini:"enable_neighbors_status_refresh"`
|
||||
StreamParserThrottle int `ini:"stream_parser_throttle"`
|
||||
}
|
||||
|
||||
// PostgresConfig is the configuration for the database
|
||||
@ -884,6 +885,13 @@ func LoadConfig(file string) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Update stream parser throttle on all birdwatcher sources
|
||||
for _, src := range sources {
|
||||
if src.Backend == SourceBackendBirdwatcher {
|
||||
src.Birdwatcher.StreamParserThrottle = server.StreamParserThrottle
|
||||
}
|
||||
}
|
||||
|
||||
config := &Config{
|
||||
Server: server,
|
||||
Postgres: psql,
|
||||
|
@ -69,6 +69,9 @@ func TestSourceConfig(t *testing.T) {
|
||||
if rs2.Birdwatcher.AltPipeProtocolSuffix != "_lg" {
|
||||
t.Error("unexpected alt_pipe_suffix:", rs2.Birdwatcher.AltPipeProtocolSuffix)
|
||||
}
|
||||
if rs2.Birdwatcher.StreamParserThrottle != 2342 {
|
||||
t.Error("Unexpected StreamParserThrottle", rs2.Birdwatcher.StreamParserThrottle)
|
||||
}
|
||||
}
|
||||
nilGoBGPConfig := gobgp.Config{}
|
||||
if rs3.GoBGP == nilGoBGPConfig {
|
||||
|
2
pkg/config/testdata/alice.conf
vendored
2
pkg/config/testdata/alice.conf
vendored
@ -25,6 +25,8 @@ neighbors_store_refresh_parallelism = 10000
|
||||
routes_store_refresh_interval = 5
|
||||
neighbors_store_refresh_interval = 5
|
||||
|
||||
stream_parser_throttle = 2342
|
||||
|
||||
store_backend = postgres
|
||||
|
||||
[postgres]
|
||||
|
Loading…
x
Reference in New Issue
Block a user