From 3fdf084902d41acc15c7a4758683976f4cdcd2bb Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 28 Jul 2015 18:08:22 +0200 Subject: [PATCH] Defaults improved for StorDb max connections --- config/cdrcconfig.go | 4 ++++ config/config_defaults.go | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/cdrcconfig.go b/config/cdrcconfig.go index 5555d0096..6122a238e 100644 --- a/config/cdrcconfig.go +++ b/config/cdrcconfig.go @@ -26,6 +26,7 @@ import ( type CdrcConfig struct { Enabled bool // Enable/Disable the profile + DryRun bool // Do not post CDRs to the server Cdrs string // The address where CDRs can be reached CdrFormat string // The type of CDR file to process FieldSeparator rune // The separator to use when reading csvs @@ -51,6 +52,9 @@ func (self *CdrcConfig) loadFromJsonCfg(jsnCfg *CdrcJsonCfg) error { if jsnCfg.Enabled != nil { self.Enabled = *jsnCfg.Enabled } + if jsnCfg.Dry_run != nil { + self.DryRun = *jsnCfg.Dry_run + } if jsnCfg.Cdrs != nil { self.Cdrs = *jsnCfg.Cdrs } diff --git a/config/config_defaults.go b/config/config_defaults.go index 0a67020e1..519b01f47 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -75,8 +75,8 @@ const CGRATES_CFG_JSON = ` "db_name": "cgrates", // stor database name "db_user": "cgrates", // username to use when connecting to stordb "db_passwd": "CGRateS.org", // password to use when connecting to stordb - "max_open_conns": 0, // maximum database connections opened - "max_idle_conns": -1, // maximum database connections idle + "max_open_conns": 100, // maximum database connections opened + "max_idle_conns": 10, // maximum database connections idle }, @@ -156,6 +156,7 @@ const CGRATES_CFG_JSON = ` "cdrc": { "*default": { "enabled": false, // enable CDR client functionality + "dry_run": false, // do not send the CDRs to CDRS, just parse them "cdrs": "internal", // address where to reach CDR server. "cdr_format": "csv", // CDR file format "field_separator": ",", // separator used in case of csv files