From c0488b546e67d73a4fd2e526e6e080b5d5d1de89 Mon Sep 17 00:00:00 2001 From: TeoV Date: Thu, 23 Jan 2020 12:17:31 +0200 Subject: [PATCH] Replace with CacheSv1.ReloadCache for LoadDestination API --- apier/v1/apier.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apier/v1/apier.go b/apier/v1/apier.go index 8bb011e7c..e38136f3b 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -228,8 +228,13 @@ func (apiv1 *ApierV1) LoadDestination(attrs AttrLoadDestination, reply *string) } else if !loaded { return utils.ErrNotFound } - if err := apiv1.DataManager.CacheDataFromDB(utils.DESTINATION_PREFIX, []string{attrs.ID}, true); err != nil { - return utils.NewErrServerError(err) + if err := apiv1.ConnMgr.Call(apiv1.Config.ApierCfg().CachesConns, nil, + utils.CacheSv1ReloadCache, utils.AttrReloadCacheWithArgDispatcher{ + AttrReloadCache: utils.AttrReloadCache{ + ArgsCache: utils.ArgsCache{DestinationIDs: &[]string{attrs.ID}}, + }, + }, reply); err != nil { + return err } *reply = utils.OK return nil