Less spammy notification
This commit is contained in:
parent
f739df494a
commit
4c94cffe1b
|
@ -204,6 +204,9 @@ def main(
|
||||||
cookiejar = []
|
cookiejar = []
|
||||||
logger.warning('No cookiejar is used')
|
logger.warning('No cookiejar is used')
|
||||||
|
|
||||||
|
if not send_email_notification:
|
||||||
|
logger.info('Email not enabled: Notifications will not be sent!')
|
||||||
|
|
||||||
for scraper_cls in available_scrapers():
|
for scraper_cls in available_scrapers():
|
||||||
session = get_session(cookiejar, with_cfscrape=scraper_cls.requires_cfscrape())
|
session = get_session(cookiejar, with_cfscrape=scraper_cls.requires_cfscrape())
|
||||||
scraper = scraper_cls(session)
|
scraper = scraper_cls(session)
|
||||||
|
@ -230,10 +233,7 @@ def main(
|
||||||
)
|
)
|
||||||
logger.info('Scraper done: %s', scraper.dataset_name)
|
logger.info('Scraper done: %s', scraper.dataset_name)
|
||||||
|
|
||||||
if status['extended']:
|
if status['extended'] and send_email_notification:
|
||||||
if send_email_notification:
|
|
||||||
send_notification(session, scraper_cls.__name__, status['dicts'][-1])
|
send_notification(session, scraper_cls.__name__, status['dicts'][-1])
|
||||||
else:
|
|
||||||
logger.info('Email not enabled: Skipping notification')
|
|
||||||
|
|
||||||
del scraper, session
|
del scraper, session
|
||||||
|
|
Loading…
Reference in New Issue
Block a user