mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixup CDRC to only log on errors but not stop the server, adding freeswitch rotate cdrs script
This commit is contained in:
@@ -152,7 +152,7 @@ func (self *Cdrc) trackCDRFiles() (err error) {
|
||||
case ev := <-watcher.Event:
|
||||
if ev.IsCreate() && (self.cgrCfg.CdrcCdrType != FS_CSV || path.Ext(ev.Name) != ".csv") {
|
||||
if err = self.processFile(ev.Name); err != nil {
|
||||
return err
|
||||
engine.Logger.Err(fmt.Sprintf("Processing file %s, error: %s", ev.Name, err.Error()))
|
||||
}
|
||||
}
|
||||
case err := <-watcher.Error:
|
||||
|
||||
12
data/scripts/freeswitch_cdr_csv_rotate.sh
Executable file
12
data/scripts/freeswitch_cdr_csv_rotate.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
FS_CDR_CSV_DIR=/var/log/freeswitch/cdr-csv
|
||||
CGR_CDRC_IN_DIR=/var/log/cgrates/cdr/in/csv
|
||||
|
||||
/usr/bin/fs_cli -x "cdr_csv rotate"
|
||||
|
||||
find $FS_CDR_CSV_DIR -maxdepth 1 -mindepth 1 -not -name *.csv -print0 | xargs -0 mv -t $CGR_CDRC_IN_DIR
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user