Skip to content

Commit

Permalink
Get last 60 minutes to make sure we have a least one record
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Mar 12, 2024
1 parent 6327a8f commit 6dce60a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openchiaapi/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()'''),
Expand Down Expand Up @@ -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()'''),
Expand Down Expand Up @@ -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()'''),
Expand Down

0 comments on commit 6dce60a

Please sign in to comment.