Tiny client for the BeatWatch dead-man's-switch monitor for cron and Celery jobs.
Project description
beatwatch
Tiny client for BeatWatch — the dead-man's-switch monitor for scheduled jobs.
Install
pip install beatwatch
# optional: pip install beatwatch[celery]
Usage
from beatwatch import ping, set_base_url
set_base_url("https://your-beatwatch.example.com")
def nightly_report():
do_the_work()
ping("<TOKEN>") # non-blocking, never raises
Set BEATWATCH_BASE_URL env var instead of calling set_base_url, if you prefer.
Celery
from beatwatch.celery import monitored_task
@monitored_task("<TOKEN>")
def cleanup_old_records():
OldRecord.objects.filter(stale=True).delete()
The ping is only emitted when the wrapped task returns successfully — failures don't ping, so missed pings really mean "the job didn't finish."
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beatwatch-0.1.0.tar.gz.
File metadata
- Download URL: beatwatch-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1cff3a7c9a6e402c0e275b78acd89346696c625ab1cba88b6ace1923550c515
|
|
| MD5 |
f59c432f1c3dbccbd988d4ef509b4d5b
|
|
| BLAKE2b-256 |
193c1b1732252f534ddac63bb664e24d9a16e99ad7d1f0112378e1172d1f0188
|
File details
Details for the file beatwatch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: beatwatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c2722ad484b9bb0efc504cf27eca1c17cb66062f7886c40117c32758d4e6b07
|
|
| MD5 |
574a00599f2e150e5c21dddc2467aaf8
|
|
| BLAKE2b-256 |
bd4aba10c2d2420b0876bba1760c03dce80c39a9fb60fa037bbd31e4b1eaaf5d
|