mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
TrendS with separate variable for Mutex, to keep vet happy
This commit is contained in:
@@ -92,7 +92,7 @@ type TrendWithAPIOpts struct {
|
||||
|
||||
// Trend is the unit matched by filters
|
||||
type Trend struct {
|
||||
*sync.RWMutex
|
||||
tMux *sync.RWMutex
|
||||
|
||||
Tenant string
|
||||
ID string
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestTrendGetTrendGrowth(t *testing.T) {
|
||||
t2 := now.Add(-2 * time.Second)
|
||||
t3 := now.Add(-3 * time.Second)
|
||||
trnd1 := &Trend{
|
||||
RWMutex: &sync.RWMutex{},
|
||||
tMux: new(sync.RWMutex),
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestTrendGetTrendLabel",
|
||||
RunTimes: []time.Time{t3, t2, t1},
|
||||
@@ -59,7 +59,8 @@ func TestTrendGetTrendLabel(t *testing.T) {
|
||||
t2 := now.Add(-2 * time.Second)
|
||||
t3 := now.Add(-3 * time.Second)
|
||||
trnd1 := &Trend{
|
||||
RWMutex: sync.RWMutex{},
|
||||
tMux: new(sync.RWMutex),
|
||||
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestTrendGetTrendLabel",
|
||||
RunTimes: []time.Time{t3, t2, t1},
|
||||
|
||||
@@ -91,8 +91,8 @@ func (tS *TrendS) computeTrend(tP *TrendProfile) {
|
||||
return
|
||||
}
|
||||
|
||||
trend.Lock()
|
||||
defer trend.Unlock()
|
||||
trend.tMux.Lock()
|
||||
defer trend.tMux.Unlock()
|
||||
|
||||
now := time.Now()
|
||||
var metrics []string
|
||||
|
||||
Reference in New Issue
Block a user