mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
Merge pull request #1782 from mintos5/master
Fixed iterating over csv files
This commit is contained in:
@@ -74,6 +74,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
|
||||
| @sebastic | Bas Couwenberg |
|
||||
| @adragusin | Adrian Drăguşin |
|
||||
| @JDLK7 | Jose Domenech |
|
||||
| @mintos5 | Michal Škuta |
|
||||
|
||||
<!-- to sign, include a single line above this comment containing the following text:
|
||||
| @username | First Last |
|
||||
|
||||
@@ -154,11 +154,11 @@ func (self *Cdrc) processCdrDir() error {
|
||||
filesInDir, _ := ioutil.ReadDir(self.dfltCdrcCfg.CDRInPath)
|
||||
for _, file := range filesInDir {
|
||||
if self.dfltCdrcCfg.CdrFormat != utils.MetaFScsv || path.Ext(file.Name()) != ".csv" {
|
||||
go func() { //Enable async processing here
|
||||
go func(file os.FileInfo) { //Enable async processing here
|
||||
if err := self.processFile(path.Join(self.dfltCdrcCfg.CDRInPath, file.Name())); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("Processing file %s, error: %s", file, err.Error()))
|
||||
}
|
||||
}()
|
||||
}(file)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user