mirror of
https://github.com/bellingcat/cisticola.git
synced 2026-06-08 03:18:34 +03:00
Fix logging logic in scraper controller
This commit is contained in:
@@ -46,12 +46,12 @@ class ScraperController:
|
||||
|
||||
if not handled:
|
||||
logger.warning(f"No handler found for Channel {channel}")
|
||||
else:
|
||||
session = self.session()
|
||||
session.bulk_save_objects(posts)
|
||||
session.commit()
|
||||
|
||||
session = self.session()
|
||||
session.bulk_save_objects(posts)
|
||||
session.commit()
|
||||
|
||||
logger.info(f"Added {len(posts)} entries to database")
|
||||
logger.info(f"Added {len(posts)} entries to database")
|
||||
|
||||
def connect_to_db(self, engine):
|
||||
# create tables
|
||||
|
||||
@@ -20,6 +20,9 @@ class TelegramSnscrapeScraper(cisticola.scraper.base.Scraper):
|
||||
g = scr.get_items()
|
||||
|
||||
for post in g:
|
||||
if (len(posts)) >= 10:
|
||||
break
|
||||
|
||||
if since is not None and post.date.replace(tzinfo=timezone.utc) <= since.date.replace(tzinfo=timezone.utc):
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user