From e00dfc3e3f8072a5bc48c9325a6a16e2eb93da7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 4 Apr 2018 23:41:22 +0200 Subject: [PATCH] Revert "chg: Catch aiohttp.ClientError" This reverts commit 9904404003a649d61ccd2117cee81fff5be43bbf. --- bgpranking/modulesfetcher.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/bgpranking/modulesfetcher.py b/bgpranking/modulesfetcher.py index 0174bc4..9b96472 100644 --- a/bgpranking/modulesfetcher.py +++ b/bgpranking/modulesfetcher.py @@ -133,18 +133,15 @@ class Fetcher(): if not await self.__newer(): unset_running('{}-{}-{}'.format(self.__class__.__name__, self.vendor, self.listname)) return - try: - async with aiohttp.ClientSession() as session: - async with session.get(self.url) as r: - content = await r.content.read() - if self.__same_as_last(content): - return - self.logger.info('Got a new file \o/') - with (self.directory / '{}.txt'.format(datetime.now().isoformat())).open('wb') as f: - f.write(content) - unset_running('{}-{}-{}'.format(self.__class__.__name__, self.vendor, self.listname)) - except aiohttp.ClientError as e: - self.logger.exception('Fetching the list failed: {}'.format(e)) + async with aiohttp.ClientSession() as session: + async with session.get(self.url) as r: + content = await r.content.read() + if self.__same_as_last(content): + return + self.logger.info('Got a new file \o/') + with (self.directory / '{}.txt'.format(datetime.now().isoformat())).open('wb') as f: + f.write(content) + unset_running('{}-{}-{}'.format(self.__class__.__name__, self.vendor, self.listname)) except PidFileError: self.logger.info('Fetcher already running') finally: