Python
urllib is enough. Open /start, call main, and open /fail if it raises.
import os
import urllib.request
url = os.environ["CRONNUDGE_URL"]
urllib.request.urlopen(url + "/start", timeout=10).read()
try:
main()
except Exception:
urllib.request.urlopen(url + "/fail", timeout=10).read()
raise
else:
urllib.request.urlopen(url, timeout=10).read()- urlopen uses GET. POST works the same if you build a Request.
- Set a timeout so a stuck CronNudge call cannot hold the job forever. The check still goes late if the ping never lands.
- A paused check records the ping and does not alert.
Longer guide: Celery beat periodic tasks · APScheduler jobs