Removed cache from multiple structs and replaced it with opts

This commit is contained in:
andronache
2021-03-16 09:12:23 +02:00
committed by Dan Christian Bogos
parent 635bdd88b8
commit 83d9c67a77
47 changed files with 479 additions and 552 deletions

View File

@@ -28,7 +28,7 @@ func init() {
c := &CmdSetRoute{
name: "routes_profile_set",
rpcMethod: utils.APIerSv1SetRouteProfile,
rpcParams: &v1.RouteWithCache{},
rpcParams: &v1.RouteWithOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +37,7 @@ func init() {
type CmdSetRoute struct {
name string
rpcMethod string
rpcParams *v1.RouteWithCache
rpcParams *v1.RouteWithOpts
*CommandExecuter
}
@@ -51,7 +51,7 @@ func (self *CmdSetRoute) RpcMethod() string {
func (self *CmdSetRoute) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &v1.RouteWithCache{
self.rpcParams = &v1.RouteWithOpts{
RouteProfile: new(engine.RouteProfile),
Opts: map[string]interface{}{},
}

View File

@@ -27,7 +27,7 @@ func init() {
c := &CmdSetThreshold{
name: "thresholds_profile_set",
rpcMethod: utils.APIerSv1SetThresholdProfile,
rpcParams: &engine.ThresholdWithCache{},
rpcParams: &engine.ThresholdProfileWithOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +37,7 @@ func init() {
type CmdSetThreshold struct {
name string
rpcMethod string
rpcParams *engine.ThresholdWithCache
rpcParams *engine.ThresholdProfileWithOpts
*CommandExecuter
}
@@ -51,7 +51,7 @@ func (self *CmdSetThreshold) RpcMethod() string {
func (self *CmdSetThreshold) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ThresholdWithCache{
self.rpcParams = &engine.ThresholdProfileWithOpts{
ThresholdProfile: new(engine.ThresholdProfile),
Opts: map[string]interface{}{},
}