Bug : hits/pages in the same second where not analyzed

This commit is contained in:
Gregory Soutade 2015-01-06 08:08:09 +01:00
parent a6ce8e1c6e
commit bfba52af8f
1 changed files with 7 additions and 2 deletions

View File

@ -267,10 +267,12 @@ class IWLA(object):
mod.hook(*args)
def isPage(self, request):
self.logger.debug("Is page %s" % (request))
for e in conf.pages_extensions:
if request.endswith(e):
self.logger.debug("True")
return True
self.logger.debug("False")
return False
def _appendHit(self, hit):
@ -627,6 +629,7 @@ class IWLA(object):
def _newHit(self, hit):
if not self.domain_name_re.match(hit['server_name']):
self.logger.debug("Not in domain %s" % (hit))
return False
t = self._decodeTime(hit)
@ -637,7 +640,9 @@ class IWLA(object):
self.current_analysis = self._deserialize(self.getDBFilename(t)) or self._clearVisits()
self.analyse_started = True
else:
if time.mktime(t) <= time.mktime(cur_time):
if not self.analyse_started and\
time.mktime(t) <= time.mktime(cur_time):
self.logger.debug("Not in time")
return False
self.analyse_started = True
if cur_time.tm_mon != t.tm_mon: