From 6dce60ac23545a731ae1dd713f0230e7f372e528 Mon Sep 17 00:00:00 2001 From: William Grzybowski Date: Tue, 12 Mar 2024 16:58:05 -0300 Subject: [PATCH] Get last 60 minutes to make sure we have a least one record --- openchiaapi/api/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openchiaapi/api/views.py b/openchiaapi/api/views.py index 3c26bae..956c214 100644 --- a/openchiaapi/api/views.py +++ b/openchiaapi/api/views.py @@ -168,7 +168,7 @@ def get(self, request, format=None): try: q = query_api.query( textwrap.dedent('''from(bucket: "openchia") - |> range(start: duration(v: "-30m")) + |> range(start: duration(v: "-60m")) |> filter(fn: (r) => r["_measurement"] == "pool_size") |> filter(fn: (r) => r["_field"] == "global") |> last()'''), @@ -197,7 +197,7 @@ def get(self, request, format=None): try: q = query_api.query( textwrap.dedent('''from(bucket: "openchia") - |> range(start: duration(v: "-30m")) + |> range(start: duration(v: "-60m")) |> filter(fn: (r) => r["_measurement"] == "mempool") |> filter(fn: (r) => r["_field"] == "full_pct") |> last()'''), @@ -252,7 +252,7 @@ def get(self, request, format=None): try: q = query_api.query( textwrap.dedent('''from(bucket: "openchia") - |> range(start: duration(v: "-30m")) + |> range(start: duration(v: "-60m")) |> filter(fn: (r) => r["_measurement"] == "pool_size") |> filter(fn: (r) => r["_field"] == "global") |> last()'''),