mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 14:48:43 +05:00
Compress a bit GetFileName of CdrReplicationCfg
This commit is contained in:
@@ -33,13 +33,8 @@ type CdrReplicationCfg struct {
|
||||
CdrFilter utils.RSRFields // Only replicate if the filters here are matching
|
||||
}
|
||||
|
||||
func (rplCfg CdrReplicationCfg) GetFallbackFileName() string {
|
||||
serverName := url.QueryEscape(rplCfg.Server)
|
||||
|
||||
result := fmt.Sprintf("cdr_%s_%s_%s.form",
|
||||
rplCfg.Transport,
|
||||
serverName, utils.GenUUID())
|
||||
return result
|
||||
func (rplCfg CdrReplicationCfg) FallbackFileName() string {
|
||||
return fmt.Sprintf("cdr_%s_%s_%s.form", rplCfg.Transport, url.QueryEscape(rplCfg.Server), utils.GenUUID())
|
||||
}
|
||||
|
||||
type SureTaxCfg struct {
|
||||
|
||||
@@ -379,11 +379,9 @@ func (self *CdrServer) replicateCdr(cdr *StoredCdr) error {
|
||||
|
||||
errChan := make(chan error)
|
||||
go func(body interface{}, rplCfg *config.CdrReplicationCfg, content string, errChan chan error) {
|
||||
|
||||
fallbackPath := path.Join(
|
||||
self.cgrCfg.HttpFailedDir,
|
||||
rplCfg.GetFallbackFileName())
|
||||
|
||||
rplCfg.FallbackFileName())
|
||||
_, err := utils.HttpPoster(
|
||||
rplCfg.Server, self.cgrCfg.HttpSkipTlsVerify, body,
|
||||
content, rplCfg.Attempts, fallbackPath)
|
||||
@@ -398,6 +396,7 @@ func (self *CdrServer) replicateCdr(cdr *StoredCdr) error {
|
||||
if rplCfg.Synchronous { // Synchronize here
|
||||
<-errChan
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user