fix v2 sched+hourly retention graph issue

This commit is contained in:
Damien Elmes 2019-02-05 12:26:36 +10:00
parent dd01561537
commit d51cdec73e

View file

@ -698,7 +698,11 @@ order by thetype, ease""" % lim)
lim = self._revlogLimit() lim = self._revlogLimit()
if lim: if lim:
lim = " and " + lim lim = " and " + lim
sd = datetime.datetime.fromtimestamp(self.col.crt) if self.col.schedVer() == 1:
sd = datetime.datetime.fromtimestamp(self.col.crt)
rolloverHour = sd.hour
else:
rolloverHour = self.col.conf["rollover"]
pd = self._periodDays() pd = self._periodDays()
if pd: if pd:
lim += " and id > %d" % ((self.col.sched.dayCutoff-(86400*pd))*1000) lim += " and id > %d" % ((self.col.sched.dayCutoff-(86400*pd))*1000)
@ -710,7 +714,7 @@ cast(count() as float) * 100,
count() count()
from revlog where type in (0,1,2) %s from revlog where type in (0,1,2) %s
group by hour having count() > 30 order by hour""" % lim, group by hour having count() > 30 order by hour""" % lim,
cut=self.col.sched.dayCutoff-(sd.hour*3600)) cut=self.col.sched.dayCutoff-(rolloverHour*3600))
# Cards # Cards
###################################################################### ######################################################################