mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Renamed structures IndexHealthReply
This commit is contained in:
committed by
Dan Christian Bogos
parent
d76d496a1e
commit
7411db3a31
@@ -831,14 +831,14 @@ type IndexHealthArgs struct {
|
||||
ObjectCacheStaticTTL bool
|
||||
}
|
||||
|
||||
type IndexHealthReply struct {
|
||||
MissingObjects []string // list of object that are referenced in indexes but are not found in the dataDB
|
||||
MissingIndexes map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes)
|
||||
BrokenReferences map[string][]string // list of broken references (the map has the key as the objectID and a list of indexes)
|
||||
type AccountActionPlanIHReply struct {
|
||||
MissingActionPlans []string // list of object that are referenced in indexes but are not found in the dataDB
|
||||
MissingAccountActionPlans map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes)
|
||||
BrokenReferences map[string][]string // list of broken references (the map has the key as the objectID and a list of indexes)
|
||||
}
|
||||
|
||||
// add cache in args API
|
||||
func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int, objTTL, indexTTL time.Duration, objStaticTTL, indexStaticTTL bool) (rply *IndexHealthReply, err error) {
|
||||
func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int, objTTL, indexTTL time.Duration, objStaticTTL, indexStaticTTL bool) (rply *AccountActionPlanIHReply, err error) {
|
||||
// posible errors
|
||||
missingAP := utils.StringSet{} // the index are present but the action plans are not //missing actionplans
|
||||
brokenRef := map[string][]string{} // the actionPlans match the index but they are missing the account // broken reference
|
||||
@@ -943,10 +943,10 @@ func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int,
|
||||
}
|
||||
}
|
||||
|
||||
rply = &IndexHealthReply{
|
||||
MissingObjects: missingAP.AsSlice(),
|
||||
MissingIndexes: missingIndex,
|
||||
BrokenReferences: brokenRef,
|
||||
rply = &AccountActionPlanIHReply{
|
||||
MissingActionPlans: missingAP.AsSlice(),
|
||||
MissingAccountActionPlans: missingIndex,
|
||||
BrokenReferences: brokenRef,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ func TestHealthAccountAction(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
exp := &IndexHealthReply{
|
||||
MissingObjects: []string{"AP1"},
|
||||
MissingIndexes: map[string][]string{"AP2": {"1002"}},
|
||||
BrokenReferences: map[string][]string{"AP2": {"1001"}},
|
||||
exp := &AccountActionPlanIHReply{
|
||||
MissingActionPlans: []string{"AP1"},
|
||||
MissingAccountActionPlans: map[string][]string{"AP2": {"1002"}},
|
||||
BrokenReferences: map[string][]string{"AP2": {"1001"}},
|
||||
}
|
||||
if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -72,10 +72,10 @@ func TestHealthAccountAction2(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
exp := &IndexHealthReply{
|
||||
MissingObjects: []string{"AP1"},
|
||||
MissingIndexes: map[string][]string{},
|
||||
BrokenReferences: map[string][]string{},
|
||||
exp := &AccountActionPlanIHReply{
|
||||
MissingActionPlans: []string{"AP1"},
|
||||
MissingAccountActionPlans: map[string][]string{},
|
||||
BrokenReferences: map[string][]string{},
|
||||
}
|
||||
if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -108,10 +108,10 @@ func TestHealthAccountAction3(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
exp := &IndexHealthReply{
|
||||
MissingObjects: []string{},
|
||||
MissingIndexes: map[string][]string{"AP2": {"1002"}},
|
||||
BrokenReferences: map[string][]string{},
|
||||
exp := &AccountActionPlanIHReply{
|
||||
MissingActionPlans: []string{},
|
||||
MissingAccountActionPlans: map[string][]string{"AP2": {"1002"}},
|
||||
BrokenReferences: map[string][]string{},
|
||||
}
|
||||
if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -147,10 +147,10 @@ func TestHealthAccountAction4(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
exp := &IndexHealthReply{
|
||||
MissingObjects: []string{},
|
||||
MissingIndexes: map[string][]string{},
|
||||
BrokenReferences: map[string][]string{"AP2": {"1002"}},
|
||||
exp := &AccountActionPlanIHReply{
|
||||
MissingActionPlans: []string{},
|
||||
MissingAccountActionPlans: map[string][]string{},
|
||||
BrokenReferences: map[string][]string{"AP2": {"1002"}},
|
||||
}
|
||||
if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user