If a day has no data then we cannot locate the oldest record so added
the date range in the response and we can use that instead.
This avoids getting stuck in the history download as we fetch 1 day at
a time.
else:
when_until = None
data = self.get_since(when_from, when_until)
- res = dict(response="ok", result=[x for x in data], version=self.version)
+ res = dict(response="ok", result=[x for x in data], version=self.version,
+ range=[when_from, when_until])
except Exception as e:
cherrypy.response.headers['content-type'] = 'application/json'
self.log("error in \"since\": {0}".format(str(e)))
plotdata[n].push([t,v]);
});
});
+ //if data is empty we need to force 'oldest'
+ if (data.result.length == 0)
+ oldest = data.range[0]*1000;
$.each(document.custom.plotdata, function(n,plot) {
document.custom.plotdata[n].data = plotdata[n].concat(plot.data);
});