summaryrefslogtreecommitdiff
path: root/schall
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-10-30 22:03:46 +0100
committerYves Fischer <yvesf-git@xapek.org>2011-10-30 22:03:46 +0100
commit6097e2a56dee7c18f640daf88c31938a3b9dc2b7 (patch)
tree0fc09839f054d53923021decc9a65ab26a7d0b6c /schall
parent770ba5201f5c60b2bb36602ff9d359f641e33125 (diff)
downloadmini-octopus-6097e2a56dee7c18f640daf88c31938a3b9dc2b7.tar.gz
mini-octopus-6097e2a56dee7c18f640daf88c31938a3b9dc2b7.zip
yield while /range reqest; set max range = 5 days
Diffstat (limited to 'schall')
-rw-r--r--schall/app.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/schall/app.py b/schall/app.py
index 657d44d..b011fe1 100644
--- a/schall/app.py
+++ b/schall/app.py
@@ -92,7 +92,7 @@ def app_range(r_from=None, r_to=None, count=1000):
r_to = timeseries.time_ms()
assert count < 10000
- assert r_to - r_from <= (timeseries.C.INT_DAY * 2), "r_to - r_from = %s < %s"%(r_to-r_from, timeseries.C.INT_DAY * 2)
+ assert r_to - r_from <= (timeseries.C.INT_DAY * 5), "r_to - r_from = %s < %s"%(r_to-r_from, timeseries.C.INT_DAY * 5)
assert r_to - r_from > db.interval, "r_to - r_from = %s > "%(r_to-r_from, db.interval)
values = []
@@ -107,6 +107,7 @@ def app_range(r_from=None, r_to=None, count=1000):
if value == 0:
value = None
values.append(value)
+ gevent.sleep(0)
values.reverse()
return json.dumps(values)