From c221c813bf26b8d7702a248c848b2b4d43591792 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Sun, 14 Dec 2014 15:41:47 +0100 Subject: [PATCH] Don't account hits <= last_access (< before) --- iwla.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iwla.py b/iwla.py index 93de2cd..81571be 100755 --- a/iwla.py +++ b/iwla.py @@ -551,10 +551,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 time.mktime(t) <= time.mktime(cur_time): return False - if not self.analyse_started: - self.analyse_started = True + self.analyse_started = True if cur_time.tm_mon != t.tm_mon: self._generateMonthStats() self.current_analysis = self._deserialize(self.getDBFilename(t)) or self._clearVisits() @@ -581,6 +580,8 @@ class IWLA(object): self.meta_infos = self._deserialize(conf.META_PATH) or self._clearMeta() if self.meta_infos['last_time']: + print 'Last time' + print self.meta_infos['last_time'] self.current_analysis = self._deserialize(self.getDBFilename(self.meta_infos['last_time'])) or self._clearVisits() else: self._clearVisits() @@ -609,8 +610,7 @@ class IWLA(object): del self.meta_infos['start_analysis_time'] self._serialize(self.meta_infos, conf.META_PATH) else: - print '==> Analyse not started : nothing to do' - self._generateMonthStats() + print '==> Analyse not started : nothing new' if __name__ == '__main__': parser = argparse.ArgumentParser(description='Intelligent Web Log Analyzer')