set default *file_csv cache TTL to 5s

File exporters require positive TTL as content is flushed only upon cache
expiration.
This commit is contained in:
ionutboangiu
2025-03-18 12:36:58 +02:00
committed by Dan Christian Bogos
parent de448ae11c
commit 364827ab58
5 changed files with 9 additions and 5 deletions

View File

@@ -401,7 +401,7 @@ func testConfigSSetConfigEEs(t *testing.T) {
"enabled": true,
"attributes_conns": []any{},
"cache": map[string]any{
"*file_csv": map[string]any{"limit": -1., "precache": false, "replicate": false, "static_ttl": false, "remote": false},
"*file_csv": map[string]any{"limit": -1., "ttl": "5s", "precache": false, "replicate": false, "static_ttl": false, "remote": false},
"*amqp_json_map": map[string]any{"limit": -1., "precache": false, "replicate": false, "static_ttl": false, "remote": false},
"*amqpv1_json_map": map[string]any{"limit": -1., "precache": false, "replicate": false, "static_ttl": false, "remote": false},
"*els": map[string]any{"limit": -1., "precache": false, "replicate": false, "static_ttl": false, "remote": false},

View File

@@ -504,7 +504,7 @@ const CGRATES_CFG_JSON = `
"enabled": false, // starts the EventReader service: <true|false>
"attributes_conns":[], // RPC Connections IDs
"cache": {
"*file_csv": {"limit": -1, "ttl": "", "static_ttl": false},
"*file_csv": {"limit": -1, "ttl": "5s", "static_ttl": false},
"*nats_json_map": {"limit": -1, "ttl": "", "static_ttl": false},
"*amqp_json_map": {"limit": -1, "ttl": "", "static_ttl": false},
"*amqpv1_json_map": {"limit": -1, "ttl": "", "static_ttl": false},

View File

@@ -2148,7 +2148,7 @@ func TestDfEventExporterCfg(t *testing.T) {
Cache: &map[string]*CacheParamJsonCfg{
utils.MetaFileCSV: {
Limit: utils.IntPointer(-1),
Ttl: utils.StringPointer(""),
Ttl: utils.StringPointer("5s"),
Static_ttl: utils.BoolPointer(false),
},
utils.MetaSQL: {

File diff suppressed because one or more lines are too long

View File

@@ -553,6 +553,7 @@ func TestEventExporterSameID(t *testing.T) {
Cache: map[string]*CacheParamCfg{
utils.MetaFileCSV: {
Limit: -1,
TTL: 5 * time.Second,
StaticTTL: false,
},
utils.MetaSQL: {