mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
wait until trying to read from fs after failure
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
// The freeswitch session manager type holding a buffer for the network connection,
|
||||
@@ -63,6 +64,9 @@ func (sm *FSSessionManager) readNextEvent() (ev Event) {
|
||||
body, err := sm.buf.ReadString('}')
|
||||
if err != nil {
|
||||
log.Print("Could not read from freeswitch connection!")
|
||||
// wait until retrying to read
|
||||
// TODO: maybe kill the manager?
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
ev = new(FSEvent).New(body)
|
||||
switch ev.GetName() {
|
||||
|
||||
@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package sessionmanager
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/balancer"
|
||||
"github.com/cgrates/cgrates/timespans"
|
||||
"log"
|
||||
"github.com/cgrates/cgrates/balancer"
|
||||
"net/rpc"
|
||||
"time"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user