mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Avoid append to primaryCdrFields due to concurrency
This commit is contained in:
@@ -159,9 +159,7 @@ func (me MapEvent) AsMapStringIgnoreErrors(ignoredFlds utils.StringMap) (mp map[
|
||||
func (me MapEvent) AsCDR(cfg *config.CGRConfig, tnt, tmz string) (cdr *CDR, err error) {
|
||||
cdr = &CDR{Tenant: tnt, Cost: -1.0, ExtraFields: make(map[string]string)}
|
||||
for k, v := range me {
|
||||
if !utils.IsSliceMember(
|
||||
append(utils.PrimaryCdrFields, utils.PreRated, utils.CostSource),
|
||||
k) { // not primary field, populate extra ones
|
||||
if !utils.IsSliceMember(utils.NotExtraCDRFields, k) { // not primary field, populate extra ones
|
||||
if cdr.ExtraFields[k], err = utils.IfaceAsString(v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ var (
|
||||
CDRExportFormats = []string{DRYRUN, MetaFileCSV, MetaFileFWV, MetaHTTPjsonCDR, MetaHTTPjsonMap, MetaHTTPjson, META_HTTP_POST, MetaAMQPjsonCDR, MetaAMQPjsonMap}
|
||||
PrimaryCdrFields = []string{CGRID, Source, OriginHost, OriginID, ToR, RequestType, Tenant, Category, Account, Subject, Destination, SetupTime, AnswerTime, Usage,
|
||||
COST, RATED, Partial, RunID}
|
||||
NotExtraCDRFields = []string{CGRID, Source, OriginHost, OriginID, ToR, RequestType, Tenant, Category, Account, Subject, Destination, SetupTime, AnswerTime, Usage,
|
||||
COST, RATED, Partial, RunID, PreRated, CostSource}
|
||||
GitLastLog string // If set, it will be processed as part of versioning
|
||||
PosterTransportContentTypes = map[string]string{
|
||||
MetaHTTPjsonCDR: CONTENT_JSON,
|
||||
|
||||
Reference in New Issue
Block a user