mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Removed hasOnlyErrors from brodcast strategy
This commit is contained in:
committed by
Dan Christian Bogos
parent
4edf3f6628
commit
47e612f5ff
@@ -230,7 +230,6 @@ func (ign *singleResultStrategyDispatcher) Dispatch(connIDs []string, conns map[
|
||||
func (ign *brodcastStrategyDispatcher) Dispatch(connIDs []string, conns map[string]*rpcclient.RpcClientPool, routeID *string,
|
||||
serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||
var hasErrors bool
|
||||
var hasOnlyErrors bool = true
|
||||
for _, connID := range connIDs {
|
||||
conn, has := conns[connID]
|
||||
if !has {
|
||||
@@ -245,17 +244,11 @@ func (ign *brodcastStrategyDispatcher) Dispatch(connIDs []string, conns map[stri
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> Network Error at %s strategy for connID %q : %s",
|
||||
utils.DispatcherS, utils.MetaBroadcast, connID, err.Error()))
|
||||
hasErrors = true
|
||||
continue
|
||||
} else if err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> Error at %s strategy for connID %q : %s",
|
||||
utils.DispatcherS, utils.MetaBroadcast, connID, err.Error()))
|
||||
hasErrors = true
|
||||
continue
|
||||
}
|
||||
hasOnlyErrors = false
|
||||
}
|
||||
if hasOnlyErrors {
|
||||
return utils.ErrNotExecuted
|
||||
}
|
||||
if hasErrors { // rewrite err if not all call were succesfull
|
||||
return utils.ErrPartiallyExecuted
|
||||
|
||||
@@ -177,8 +177,8 @@ func testDspResponderBroadcast(t *testing.T) {
|
||||
allEngine.stopEngine(t)
|
||||
pingReply = ""
|
||||
if err := dispEngine.RCP.Call(utils.ResponderPing, pingEv, &pingReply); err == nil ||
|
||||
err.Error() != utils.ErrNotExecuted.Error() {
|
||||
t.Errorf("Expected error: %s received error: %v and reply %q", utils.ErrNotExecuted.Error(), err, pingReply)
|
||||
err.Error() != utils.ErrPartiallyExecuted.Error() {
|
||||
t.Errorf("Expected error: %s received error: %v and reply %q", utils.ErrPartiallyExecuted.Error(), err, pingReply)
|
||||
}
|
||||
allEngine.startEngine(t)
|
||||
allEngine2.startEngine(t)
|
||||
|
||||
@@ -51,7 +51,6 @@ var (
|
||||
ErrResourceUnauthorized = errors.New("RESOURCE_UNAUTHORIZED")
|
||||
ErrNoActiveSession = errors.New("NO_ACTIVE_SESSION")
|
||||
ErrPartiallyExecuted = errors.New("PARTIALLY_EXECUTED")
|
||||
ErrNotExecuted = errors.New("NOT_EXECUTED")
|
||||
ErrMaxUsageExceeded = errors.New("MAX_USAGE_EXCEEDED")
|
||||
ErrUnallocatedResource = errors.New("UNALLOCATED_RESOURCE")
|
||||
ErrNotFoundNoCaps = errors.New("not found")
|
||||
|
||||
Reference in New Issue
Block a user