mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
use Set method to update ExportPath for csv/fwv ee
prevents manual locking
This commit is contained in:
committed by
Dan Christian Bogos
parent
7166795066
commit
e1c154b9e0
@@ -65,9 +65,7 @@ func (fCsv *FileCSVee) init() (err error) {
|
||||
// create the file
|
||||
filePath := path.Join(fCsv.Cfg().ExportPath,
|
||||
fCsv.Cfg().ID+utils.Underline+utils.UUIDSha1Prefix()+utils.CSVSuffix)
|
||||
fCsv.dc.Lock()
|
||||
fCsv.dc.MapStorage[utils.ExportPath] = filePath
|
||||
fCsv.dc.Unlock()
|
||||
fCsv.dc.Set([]string{utils.ExportPath}, filePath)
|
||||
if fCsv.file, err = os.Create(filePath); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -59,9 +59,7 @@ type FileFWVee struct {
|
||||
func (fFwv *FileFWVee) init() (err error) {
|
||||
filePath := path.Join(fFwv.Cfg().ExportPath,
|
||||
fFwv.Cfg().ID+utils.Underline+utils.UUIDSha1Prefix()+utils.FWVSuffix)
|
||||
fFwv.dc.Lock()
|
||||
fFwv.dc.MapStorage[utils.ExportPath] = filePath
|
||||
fFwv.dc.Unlock()
|
||||
fFwv.dc.Set([]string{utils.ExportPath}, filePath)
|
||||
// create the file
|
||||
if fFwv.file, err = os.Create(filePath); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user