1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

use cache size; default cache ttl fixed

This commit is contained in:
Annika Hannig
2021-09-15 17:44:18 +02:00
parent 9c193029a0
commit 8b5509f0c3

View File

@ -734,7 +734,7 @@ func getSources(config *ini.File) ([]*SourceConfig, error) {
case SourceBackendOpenBGPDStateServer:
// Get cache TTL and reject communities from the config
cacheTTL := time.Second * time.Duration(backendConfig.Key("cache_ttl").MustInt(0))
cacheTTL := time.Second * time.Duration(backendConfig.Key("cache_ttl").MustInt(300))
routesCacheSize := backendConfig.Key("routes_cache_size").MustInt(1024)
rc, err := getRoutesRejections(config)
if err != nil {
@ -754,7 +754,8 @@ func getSources(config *ini.File) ([]*SourceConfig, error) {
case SourceBackendOpenBGPDBgplgd:
// Get cache TTL from the config
cacheTTL := time.Second * time.Duration(backendConfig.Key("cache_ttl").MustInt(0))
cacheTTL := time.Second * time.Duration(backendConfig.Key("cache_ttl").MustInt(300))
routesCacheSize := backendConfig.Key("routes_cache_size").MustInt(1024)
rc, err := getRoutesRejections(config)
if err != nil {
return nil, err
@ -765,6 +766,7 @@ func getSources(config *ini.File) ([]*SourceConfig, error) {
ID: srcCfg.ID,
Name: srcCfg.Name,
CacheTTL: cacheTTL,
RoutesCacheSize: routesCacheSize,
RejectCommunities: rejectComms,
}
backendConfig.MapTo(&c)