From f86e0c0a5aae3e8f83941023f4e75d0ec877fbc9 Mon Sep 17 00:00:00 2001 From: AlteredCoder <64792091+AlteredCoder@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:23:30 +0100 Subject: [PATCH] don't send decisions with negative duration to bouncers (#1117) --- pkg/database/decisions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/database/decisions.go b/pkg/database/decisions.go index 5f542db50..3132dce4d 100644 --- a/pkg/database/decisions.go +++ b/pkg/database/decisions.go @@ -222,7 +222,7 @@ func (c *Client) QueryExpiredDecisionsSinceWithFilters(since time.Time, filters } func (c *Client) QueryNewDecisionsSinceWithFilters(since time.Time, filters map[string][]string) ([]*ent.Decision, error) { - query := c.Ent.Decision.Query().Where(decision.CreatedAtGT(since)) + query := c.Ent.Decision.Query().Where(decision.CreatedAtGT(since)).Where(decision.UntilGT(time.Now())) query, err := BuildDecisionRequestWithFilter(query, filters) if err != nil { c.Log.Warningf("QueryNewDecisionsSinceWithFilters : %s", err)