Skip to content

Commit

Permalink
Merge pull request #24 from rafaelpezzuto/fix-device-detector
Browse files Browse the repository at this point in the history
Corrige DeviceDetector ao obter ZeroDivisionError
  • Loading branch information
rafaelpezzuto authored Mar 2, 2022
2 parents 040a5a7 + 532868c commit 634c9dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/lib/logparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ def parse_line(self, line):
try:
device = DeviceDetector(hit.user_agent).parse()
except ZeroDivisionError:
device = DeviceDetector('').parse()
self.stats.increment('ignored_lines_invalid_user_agent')
logging.error(DeviceDetectionError(f'Não foi possível identificar UserAgent {hit.user_agent} from line {decoded_line}'))
hit.is_valid = False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='scielo-usage-counter',
version='0.4.4',
version='0.4.5',
description='The SciELO Usage Counter Tool',
author='SciELO',
author_email='[email protected]',
Expand Down

0 comments on commit 634c9dc

Please sign in to comment.