mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 13:49:53 +05:00
Dispatchers and cache
This commit is contained in:
@@ -137,6 +137,11 @@ func (admS *AdminSv1) SetDispatcherProfile(ctx *context.Context, args *Dispatche
|
||||
args.TenantID(), &args.FilterIDs, args.APIOpts); err != nil {
|
||||
return utils.APIErrorHandler(err)
|
||||
}
|
||||
//handle caching for DispatcherProfile
|
||||
if err := admS.CallCache(ctx, utils.IfaceAsString(args.APIOpts[utils.MetaCache]), args.Tenant, utils.CacheDispatcherProfiles,
|
||||
args.TenantID(), &args.FilterIDs, args.APIOpts); err != nil {
|
||||
return utils.APIErrorHandler(err)
|
||||
}
|
||||
*reply = utils.OK
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ func (chS *CacheS) GetWithRemote(ctx *context.Context, args *utils.ArgsGetCacheI
|
||||
}
|
||||
if len(chS.cfg.CacheCfg().RemoteConns) == 0 ||
|
||||
!chS.cfg.CacheCfg().Partitions[args.CacheID].Remote {
|
||||
return nil, fmt.Errorf("Remote connections are missing from Cache config or Remote field of partition: %s is false", args.CacheID)
|
||||
return nil, utils.ErrNotFound
|
||||
}
|
||||
// item was not found locally, query from remote
|
||||
if err = chS.connMgr.Call(ctx, chS.cfg.CacheCfg().RemoteConns,
|
||||
|
||||
@@ -463,6 +463,8 @@ func NewAttrReloadCacheWithOptsFromMap(arg map[string][]string, tnt string, opts
|
||||
ChargerProfileIDs: arg[CacheChargerProfiles],
|
||||
DispatcherProfileIDs: arg[CacheDispatcherProfiles],
|
||||
DispatcherHostIDs: arg[CacheDispatcherHosts],
|
||||
Dispatchers: arg[CacheDispatchers],
|
||||
DispatcherRoutes: arg[CacheDispatcherRoutes],
|
||||
RateProfileIDs: arg[CacheRateProfiles],
|
||||
ActionProfileIDs: arg[CacheActionProfiles],
|
||||
AccountIDs: arg[CacheAccounts],
|
||||
@@ -497,6 +499,8 @@ type AttrReloadCacheWithAPIOpts struct {
|
||||
ChargerProfileIDs []string `json:",omitempty"`
|
||||
DispatcherProfileIDs []string `json:",omitempty"`
|
||||
DispatcherHostIDs []string `json:",omitempty"`
|
||||
Dispatchers []string `json:",omitempty"`
|
||||
DispatcherRoutes []string `json:",omitempty"`
|
||||
RateProfileIDs []string `json:",omitempty"`
|
||||
ActionProfileIDs []string `json:",omitempty"`
|
||||
AccountIDs []string `json:",omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user