mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-23 16:07:39 +00:00
17 lines
428 B
Plaintext
17 lines
428 B
Plaintext
import requests
|
|
URL = "PING_URL"
|
|
|
|
def do_work():
|
|
# Do your number crunching, backup dumping, newsletter sending work here.
|
|
# Return a truthy value on success.
|
|
# Return a falsy value or throw an exception on failure.
|
|
return True
|
|
|
|
success = False
|
|
try:
|
|
success = do_work()
|
|
finally:
|
|
# On success, requests PING_URL
|
|
# On failure, requests PING_URL/fail
|
|
requests.get(URL if success else URL + "/fail")
|