mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Protect Trend.asTrendSummary method
This commit is contained in:
@@ -123,7 +123,7 @@ func (t *Trend) Clone() (tC *Trend) {
|
||||
}
|
||||
|
||||
// AsTrendSummary transforms the trend into TrendSummary
|
||||
func (t *Trend) AsTrendSummary() (ts *TrendSummary) {
|
||||
func (t *Trend) asTrendSummary() (ts *TrendSummary) {
|
||||
ts = &TrendSummary{
|
||||
Tenant: t.Tenant,
|
||||
ID: t.ID,
|
||||
|
||||
@@ -180,7 +180,9 @@ func (tS *TrendS) processThresholds(trnd *Trend) (err error) {
|
||||
copy(thIDs, trnd.tPrfl.ThresholdIDs)
|
||||
}
|
||||
opts[utils.OptsThresholdsProfileIDs] = thIDs
|
||||
ts := trnd.AsTrendSummary()
|
||||
trnd.tMux.RLock()
|
||||
ts := trnd.asTrendSummary()
|
||||
trnd.tMux.RUnlock()
|
||||
trndEv := &utils.CGREvent{
|
||||
Tenant: trnd.Tenant,
|
||||
ID: utils.GenUUID(),
|
||||
@@ -218,7 +220,9 @@ func (tS *TrendS) processEEs(trnd *Trend) (err error) {
|
||||
opts := map[string]any{
|
||||
utils.MetaEventType: utils.TrendUpdate,
|
||||
}
|
||||
ts := trnd.AsTrendSummary()
|
||||
trnd.tMux.RLock()
|
||||
ts := trnd.asTrendSummary()
|
||||
trnd.tMux.RUnlock()
|
||||
trndEv := &CGREventWithEeIDs{
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: trnd.Tenant,
|
||||
|
||||
Reference in New Issue
Block a user