wait until trying to read from fs after failure

This commit is contained in:
Radu Ioan Fericean
2012-07-13 17:30:20 +03:00
parent fb40cbdd19
commit 514af52420
2 changed files with 5 additions and 1 deletions

View File

@@ -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() {

View File

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