simplify TimeNow parsing for ee metrics

This commit is contained in:
ionutboangiu
2025-03-14 09:41:15 +02:00
committed by Dan Christian Bogos
parent 172e846d3f
commit 132aecd3c1

View File

@@ -137,7 +137,6 @@ func composeExp(fields []*config.FCTemplate, cgrEv *utils.CGREvent, dc utils.Dat
}
func newEEMetrics(location string) (*utils.SafeMapStorage, error) {
tNow := time.Now()
loc, err := time.LoadLocation(location)
if err != nil {
return nil, err
@@ -146,8 +145,7 @@ func newEEMetrics(location string) (*utils.SafeMapStorage, error) {
utils.NumberOfEvents: int64(0),
utils.PositiveExports: utils.StringSet{},
utils.NegativeExports: utils.StringSet{},
utils.TimeNow: time.Date(tNow.Year(), tNow.Month(), tNow.Day(),
tNow.Hour(), tNow.Minute(), tNow.Second(), tNow.Nanosecond(), loc),
utils.TimeNow: time.Now().In(loc),
}}, nil
}