diff --git a/config/config_defaults.go b/config/config_defaults.go index fda1b2ce2..73d80b5e6 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -130,8 +130,8 @@ const CGRATES_CFG_JSON = ` "resource_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control resource profiles caching "resources": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control resources caching "event_resources": {"limit": -1, "ttl": "", "static_ttl": false}, // matching resources to events - "statqueue_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueue profiles - "statqueues": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueues with metrics + "statqueue_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueue profiles + "statqueues": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // statqueues with metrics "threshold_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control threshold profiles caching "thresholds": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control thresholds caching "filters": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false}, // control filters caching @@ -148,6 +148,7 @@ const CGRATES_CFG_JSON = ` "dispatcher_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false}, // control dispatcher filter indexes caching "dispatcher_routes": {"limit": -1, "ttl": "", "static_ttl": false}, // control dispatcher routes caching "diameter_messages": {"limit": -1, "ttl": "3h", "static_ttl": false}, // diameter messages caching + "rpc_responses": {"limit": -1, "ttl": "2s", "static_ttl": false}, // RPC responses caching }, diff --git a/config/config_json_test.go b/config/config_json_test.go index 4254cdc4d..353e1d1ad 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -154,6 +154,8 @@ func TestCacheJsonCfg(t *testing.T) { Ttl: utils.StringPointer(""), Static_ttl: utils.BoolPointer(false)}, utils.CacheDiameterMessages: &CacheParamJsonCfg{Limit: utils.IntPointer(-1), Ttl: utils.StringPointer("3h"), Static_ttl: utils.BoolPointer(false)}, + utils.CacheRPCResponses: &CacheParamJsonCfg{Limit: utils.IntPointer(-1), + Ttl: utils.StringPointer("2s"), Static_ttl: utils.BoolPointer(false)}, } if gCfg, err := dfCgrJsonCfg.CacheJsonCfg(); err != nil { diff --git a/config/config_test.go b/config/config_test.go index 47b4781e6..2a5397c68 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -705,6 +705,8 @@ func TestCgrCfgJSONDefaultsCacheCFG(t *testing.T) { TTL: time.Duration(0), StaticTTL: false, Precache: false}, utils.CacheDiameterMessages: &CacheParamCfg{Limit: -1, TTL: time.Duration(3 * time.Hour), StaticTTL: false}, + utils.CacheRPCResponses: &CacheParamCfg{Limit: -1, + TTL: time.Duration(2 * time.Second), StaticTTL: false}, } if !reflect.DeepEqual(eCacheCfg, cgrCfg.CacheCfg()) { diff --git a/utils/consts.go b/utils/consts.go index 3bd6112e8..1abbd19e0 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -941,6 +941,7 @@ const ( CacheChargerFilterIndexes = "charger_filter_indexes" CacheDispatcherFilterIndexes = "dispatcher_filter_indexes" CacheDiameterMessages = "diameter_messages" + CacheRPCResponses = "rpc_responses" MetaPrecaching = "*precaching" MetaReady = "*ready" )