mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Remove unnecessary verifications from Dispatch
This commit is contained in:
committed by
Dan Christian Bogos
parent
f9fbaeaeed
commit
e85a1411c4
@@ -162,14 +162,7 @@ func (dS *DispatcherService) dispatcherProfilesForEvent(ctx *context.Context, tn
|
||||
// Dispatch is the method forwarding the request towards the right connection
|
||||
func (dS *DispatcherService) Dispatch(ctx *context.Context, ev *utils.CGREvent, subsys string,
|
||||
serviceMethod string, args, reply interface{}) (err error) {
|
||||
// fix missing tenant
|
||||
tnt := ev.Tenant
|
||||
if tnt == utils.EmptyString {
|
||||
tnt = dS.cfg.GeneralCfg().DefaultTenant
|
||||
}
|
||||
if ev.APIOpts == nil {
|
||||
ev.APIOpts = make(map[string]interface{})
|
||||
}
|
||||
if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 {
|
||||
if err = dS.authorize(ctx, serviceMethod, tnt, utils.IfaceAsString(ev.APIOpts[utils.OptsAPIKey])); err != nil {
|
||||
return
|
||||
@@ -183,7 +176,6 @@ func (dS *DispatcherService) Dispatch(ctx *context.Context, ev *utils.CGREvent,
|
||||
utils.MetaMethod: serviceMethod,
|
||||
},
|
||||
}
|
||||
|
||||
dspLoopAPIOpts := map[string]interface{}{
|
||||
utils.MetaSubsys: utils.MetaDispatchers,
|
||||
utils.MetaNodeID: dS.cfg.GeneralCfg().NodeID,
|
||||
|
||||
Reference in New Issue
Block a user