Skip to content

Slack notification after 30min of scraping#51

Open
andela-ookoro wants to merge 2 commits into
CodeForAfrica-SCRAPERS:developfrom
andela-ookoro:slackNotificationAfter30min
Open

Slack notification after 30min of scraping#51
andela-ookoro wants to merge 2 commits into
CodeForAfrica-SCRAPERS:developfrom
andela-ookoro:slackNotificationAfter30min

Conversation

@andela-ookoro

@andela-ookoro andela-ookoro commented Oct 27, 2017

Copy link
Copy Markdown
Contributor

This Pull Request adds a feature which sends a slack notification after a scraping session is running for more than 30 minutes.
You need to export the 'MORPH_WEBHOOK_URL' as it is the identifier to the slack app.

Comment thread scraper.py Outdated
import random
scraper_id = random.randint(1, 100000)
error['MESSAGE'] = 'Scraper: {} is taking more than 30 minutes'.format(scraper_id)
scraper.print_error(error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it isn't exactly an error, let's have this as a warning instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I have change the log level to warning.

@DavidLemayian

Copy link
Copy Markdown
Contributor

Has this been tested on Morph.io?

@andela-ookoro

Copy link
Copy Markdown
Contributor Author

I did not test this feature on Morph.io, I tested it using slack_log_handler.
I would raise a PR for configuring python logging include slack_log_handler.

@DavidLemayian

Copy link
Copy Markdown
Contributor

So the scraper works on Morph.io so definitely should be tested there to ensure compatibility. Once done, send me a link to your Morph implementation.

@andela-ookoro andela-ookoro force-pushed the slackNotificationAfter30min branch from 4297208 to 0187d15 Compare November 22, 2017 15:33
@andela-ookoro andela-ookoro force-pushed the slackNotificationAfter30min branch from 0187d15 to d19805a Compare November 22, 2017 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants