Updated healthchecks to have a run time
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
jblu 2024-05-28 15:43:54 -05:00
parent 58ea766027
commit e8ac879403
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,6 @@
def healthcheck_ping(req_obj, url):
def healthcheck_ping(req_obj, url, start=False):
if start == True:
url + '/start'
try:
req_obj.get(url, timeout=10)
except req_obj.RequestException as e:

View File

@ -77,6 +77,10 @@ apprise_aurls = os.getenv("apprise_aurls")
apprise_title = os.getenv("apprise_title")
apprise_body = os.getenv("apprise_body")
# healthcheck - Tell healthchecks.io we are starting the backup
if healthcheck:
healthcheck_ping(r, healthcheck_url, start=True)
# Stop seafile and seafile hub
if docker_command:
os.system(f'docker exec {container_name} /opt/seafile/seafile-serverlatest/seahub.sh stop')