From 6097e2a56dee7c18f640daf88c31938a3b9dc2b7 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 30 Oct 2011 22:03:46 +0100 Subject: yield while /range reqest; set max range = 5 days --- schall/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1