You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
522 B

  1. import requests
  2. URL = "PING_URL"
  3. # "/start" kicks off a timer: if the job takes longer than
  4. # the configured grace time, the check will be marked as "down"
  5. try:
  6. requests.get(URL + "/start", timeout=5)
  7. except requests.exceptions.RequestException:
  8. # If the network request fails for any reason, we don't want
  9. # it to prevent the main job from running
  10. pass
  11. # TODO: run the job here
  12. fib = lambda n: n if n < 2 else fib(n - 1) + fib(n - 2)
  13. print("F(42) = %d" % fib(42))
  14. # Signal success:
  15. requests.get(URL)