diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-30 22:03:46 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-30 22:03:46 +0100 |
commit | 6097e2a56dee7c18f640daf88c31938a3b9dc2b7 (patch) | |
tree | 0fc09839f054d53923021decc9a65ab26a7d0b6c | |
parent | 770ba5201f5c60b2bb36602ff9d359f641e33125 (diff) | |
download | mini-octopus-6097e2a56dee7c18f640daf88c31938a3b9dc2b7.tar.gz mini-octopus-6097e2a56dee7c18f640daf88c31938a3b9dc2b7.zip |
yield while /range reqest; set max range = 5 days
-rw-r--r-- | schall/app.py | 3 |
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) |