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:
@ -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)
|
||||
|
Reference in New Issue
Block a user