Added Resource,Threshold and Stats ids to TPReader cache reload

This commit is contained in:
Trial97
2021-05-06 13:03:50 +03:00
committed by Dan Christian Bogos
parent 7c109c5fd1
commit 4d90083da2

View File

@@ -839,6 +839,24 @@ func (tpr *TpReader) ShowStatistics() {
// GetLoadedIds returns the identities loaded for a specific category, useful for cache reloads
func (tpr *TpReader) GetLoadedIds(categ string) ([]string, error) {
switch categ {
case utils.ResourcesPrefix:
keys := make([]string, len(tpr.resources))
for i, k := range tpr.resources {
keys[i] = k.TenantID()
}
return keys, nil
case utils.StatQueuePrefix:
keys := make([]string, len(tpr.statQueues))
for i, k := range tpr.statQueues {
keys[i] = k.TenantID()
}
return keys, nil
case utils.ThresholdPrefix:
keys := make([]string, len(tpr.thresholds))
for i, k := range tpr.thresholds {
keys[i] = k.TenantID()
}
return keys, nil
case utils.DestinationPrefix:
keys := make([]string, len(tpr.destinations))
i := 0