From 8d7bc32993c4729d2fce3f8dbe278148ece6222a Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 3 Oct 2022 15:19:32 +0200 Subject: [PATCH] feat(chalice): support null-duration for resources --- ee/api/chalicelib/core/resources.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/api/chalicelib/core/resources.py b/ee/api/chalicelib/core/resources.py index 7666e66cf..6132ce33d 100644 --- a/ee/api/chalicelib/core/resources.py +++ b/ee/api/chalicelib/core/resources.py @@ -6,6 +6,8 @@ from decouple import config def get_by_session_id(session_id, project_id, start_ts, duration): with ch_client.ClickHouseClient() as ch: + if duration is None or (type(duration) != 'int' and type(duration) != 'float') or duration < 0: + duration = 0 delta = config("events_ts_delta", cast=int, default=5 * 60) * 1000 ch_query = """\ SELECT