X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7e43a00fd352fa3f43bb9041a0782eff3bf0be0a..158628553f39cf4508a54021af71bc4836e893e8:/utils/cron_ipanalyse.py?ds=inline diff --git a/utils/cron_ipanalyse.py b/utils/cron_ipanalyse.py index 262090a4..aba5e510 100755 --- a/utils/cron_ipanalyse.py +++ b/utils/cron_ipanalyse.py @@ -84,11 +84,11 @@ class LogEntry: if qp[0] == 'OPTIONS': self.request = None else: - if qp[1].startswith('/search'): + if '/search' in qp[1]: self.request = 'S' - elif qp[1].startswith('/reverse'): + elif '/reverse' in qp[1]: self.request = 'R' - elif qp[1].startswith('/details'): + elif '/details' in qp[1]: self.request = 'D' else: self.request = None @@ -186,7 +186,10 @@ class LogFile: def loglines(self): for l in self.fd: - yield LogEntry(l) + try: + yield LogEntry(l) + except ValueError: + pass # ignore invalid lines class BlockList: