From 6f067db57f1ed83ed26d1d45a5879436057e6ee1 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 30 Apr 2025 13:52:18 +0200 Subject: [PATCH] use custom duration type in expr helpers --- pkg/exprhelpers/helpers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/exprhelpers/helpers.go b/pkg/exprhelpers/helpers.go index 22bca7d06..fd68db174 100644 --- a/pkg/exprhelpers/helpers.go +++ b/pkg/exprhelpers/helpers.go @@ -29,6 +29,8 @@ import ( "github.com/umahmood/haversine" "github.com/wasilibs/go-re2" + "github.com/crowdsecurity/go-cs-lib/cstime" + "github.com/crowdsecurity/crowdsec/pkg/cache" "github.com/crowdsecurity/crowdsec/pkg/database" "github.com/crowdsecurity/crowdsec/pkg/fflag" @@ -661,7 +663,7 @@ func GetDecisionsSinceCount(params ...any) (any, error) { return 0, nil } - sinceDuration, err := time.ParseDuration(since) + sinceDuration, err := cstime.ParseDuration(since) if err != nil { log.Errorf("Failed to parse since parameter '%s' : %s", since, err) return 0, nil