Merge pull request #1782 from mintos5/master

Fixed iterating over csv files
This commit is contained in:
Dan Christian Bogos
2019-11-28 11:53:58 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -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 |

View File

@@ -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