From 1ea90db3ad8807fb3686b917e2947a22729c61a8 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Fri, 27 Sep 2019 18:44:56 +0200 Subject: [PATCH] measure execution time if healthcheck is enabled --- infomentor/__main__.py | 5 ++++- infomentor/filestorage.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 infomentor/filestorage.py diff --git a/infomentor/__main__.py b/infomentor/__main__.py index 2ad8f57..546ee46 100644 --- a/infomentor/__main__.py +++ b/infomentor/__main__.py @@ -140,7 +140,7 @@ def notify_users(): session = db.get_db() cfg = config.load() if cfg["healthchecks"]["url"] != "": - requests.get(cfg["healthchecks"]["url"]) + requests.get(cfg["healthchecks"]["url"] + '/start') for user in session.query(model.User): logger.info("==== USER: %s =====", user.name) @@ -189,6 +189,9 @@ def notify_users(): logger.info("New API status: %s", user.apistatus) session.commit() + if cfg["healthchecks"]["url"] != "": + requests.get(cfg["healthchecks"]["url"]) + def main(): args = parse_args(sys.argv[1:]) diff --git a/infomentor/filestorage.py b/infomentor/filestorage.py new file mode 100644 index 0000000..2746908 --- /dev/null +++ b/infomentor/filestorage.py @@ -0,0 +1,4 @@ +from infomentor import model, db, icloudcalendar, config +cfg = config.load() + +class Attachment(object):