mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
better locking for history server
This commit is contained in:
@@ -68,7 +68,6 @@ func NewFileScribe(fileRoot string) (*FileScribe, error) {
|
||||
|
||||
func (s *FileScribe) Record(rec *Record, out *int) error {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
var fileToSave string
|
||||
switch {
|
||||
case strings.HasPrefix(rec.Key, DESTINATION_PREFIX):
|
||||
@@ -87,6 +86,7 @@ func (s *FileScribe) Record(rec *Record, out *int) error {
|
||||
s.loopChecker <- 1
|
||||
}
|
||||
s.waitingFile = fileToSave
|
||||
defer s.Unlock()
|
||||
go func() {
|
||||
t := time.NewTicker(1 * time.Second)
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user