mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Replaced cache with opts in several structs
This commit is contained in:
committed by
Dan Christian Bogos
parent
83d9c67a77
commit
22f207441e
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package console
|
||||
|
||||
import (
|
||||
v1 "github.com/cgrates/cgrates/apier/v1"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -27,7 +26,7 @@ func init() {
|
||||
c := &CmdSetAccountProfile{
|
||||
name: "accounts_profile_set",
|
||||
rpcMethod: utils.APIerSv1SetAccountProfile,
|
||||
rpcParams: &v1.APIAccountProfileWithCache{},
|
||||
rpcParams: &utils.APIAccountProfileWithOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -36,7 +35,7 @@ func init() {
|
||||
type CmdSetAccountProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *v1.APIAccountProfileWithCache
|
||||
rpcParams *utils.APIAccountProfileWithOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
@@ -50,7 +49,7 @@ func (self *CmdSetAccountProfile) RpcMethod() string {
|
||||
|
||||
func (self *CmdSetAccountProfile) RpcParams(reset bool) interface{} {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &v1.APIAccountProfileWithCache{APIAccountProfile: new(utils.APIAccountProfile)}
|
||||
self.rpcParams = &utils.APIAccountProfileWithOpts{APIAccountProfile: new(utils.APIAccountProfile)}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ func init() {
|
||||
c := &CmdSetAttributes{
|
||||
name: "attributes_profile_set",
|
||||
rpcMethod: utils.APIerSv2SetAttributeProfile,
|
||||
rpcParams: &v2.AttributeWithCache{},
|
||||
rpcParams: &v2.AttributeWithOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -37,7 +37,7 @@ func init() {
|
||||
type CmdSetAttributes struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *v2.AttributeWithCache
|
||||
rpcParams *v2.AttributeWithOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func (self *CmdSetAttributes) RpcMethod() string {
|
||||
|
||||
func (self *CmdSetAttributes) RpcParams(reset bool) interface{} {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &v2.AttributeWithCache{APIAttributeProfile: new(engine.APIAttributeProfile)}
|
||||
self.rpcParams = &v2.AttributeWithOpts{APIAttributeProfile: new(engine.APIAttributeProfile)}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ func init() {
|
||||
c := &CmdSetStatQueue{
|
||||
name: "stats_profile_set",
|
||||
rpcMethod: utils.APIerSv1SetStatQueueProfile,
|
||||
rpcParams: &engine.StatQueueWithCache{},
|
||||
rpcParams: &engine.StatQueueProfileWithOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -37,7 +37,7 @@ func init() {
|
||||
type CmdSetStatQueue struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *engine.StatQueueWithCache
|
||||
rpcParams *engine.StatQueueProfileWithOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func (self *CmdSetStatQueue) RpcMethod() string {
|
||||
|
||||
func (self *CmdSetStatQueue) RpcParams(reset bool) interface{} {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &engine.StatQueueWithCache{
|
||||
self.rpcParams = &engine.StatQueueProfileWithOpts{
|
||||
StatQueueProfile: new(engine.StatQueueProfile),
|
||||
Opts: make(map[string]interface{}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user