fixed returning none as a result returning reverse function

Reverse does everything inplace and does not return a reversed list
hence resulting in a broken script.
This commit is contained in:
雲華
2021-08-17 20:24:53 -04:00
parent af948965b0
commit f277839679
2 changed files with 5 additions and 2 deletions

View File

@@ -10,4 +10,5 @@ RUN python3 -m venv venv && \
RUN mkdir database && \
touch database/news.db
CMD ["venv/bin/python", "main.py"]

View File

@@ -72,12 +72,14 @@ class NewsScraper:
_hash = hashlib.md5(article_meta.__str__().encode('UTF-8'), usedforsecurity=False).hexdigest()
if self._check_hash(_hash, 'news_hashes'):
return
articles.reverse()
return articles
else:
self._store_hash(_hash, 'news_hashes')
articles.append(article_meta)
return articles.reverse()
articles.reverse()
return articles
async def close(self):
await self.client.close()