Decorator that pings URLs before and after executing the wrapped obj.
Project description
babis
Decorator that pings URLs before and after executing the wrapped obj.
Free software: GNU General Public License v3
Documentation: https://babis.readthedocs.io.
Features
Pre and After run pings
Custom user agent
Silent failures
Usage
Ping after successful execution. Useful to monitor cron jobs with services like Dead Man’s Snitch or HealthChecks.io:
@babis.decorator(ping_after='http://healthchecks.io/XXX') def cron_job(): pass
Some services support pre and after hooks to measure the running time:
@babis.decorator(ping_before='http://healthchecks.io/XXX', ping_after='http://healthchecks.io/XXX') def measured_cron_job(): pass
You can also send a POST instead of the default GET:
@babis.decorator(ping_before='http://healthchecks.io/XXX', method='post') def cron_job_with_post(): pass
And if you don’t care if the ping fails, silence the errors:
@babis.decorator(ping_before='http://healthchecks.io/XXX', silent_failures=True) def cron_job_silent_failure(): pass
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2016-08-23)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for babis-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72164b5371c3a83dbd91dcc68876639dc11b1e9ead97a1601a768c3d996a5707 |
|
MD5 | a4a4408e9d870744a85dea09aeff306d |
|
BLAKE2b-256 | 1528543740496b6d68130d57d2ebd45c54e2017db6feb13ec626c2d18cc7cbac |