diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | guix.scm | 2 | ||||
-rw-r--r-- | tojo-tokyo/monitoring.scm | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 757ddaa..8dfe068 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([guile-tojo-tokyo-monitoring], [0.1.0]) +AC_INIT([guile-tojo-tokyo-monitoring], [0.1.1]) AC_CONFIG_SRCDIR([tojo-tokyo/monitoring.scm]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) @@ -29,7 +29,7 @@ (define guile-tojo-tokyo-monitoring (package (name "guile-tojo-tokyo-monitoring") - (version "0.1.0") + (version "0.1.1") (source (string-append (getcwd) "/guile-tojo-tokyo-monitoring-" version ".tar.gz")) (build-system gnu-build-system) (native-inputs diff --git a/tojo-tokyo/monitoring.scm b/tojo-tokyo/monitoring.scm index ad5d34e..7d55dda 100644 --- a/tojo-tokyo/monitoring.scm +++ b/tojo-tokyo/monitoring.scm @@ -55,5 +55,9 @@ (string=? (substring fs 0 5) "/dev/")))) (df)))) -(define-public (heartbeat) - (http-request (current-heartbeat-url))) +(define-syntax-rule (heartbeat ((p? body ...) ...)) + (let ((heartbeat-cancel? #f)) + (when p? body ... (set! heartbeat-cancel? #t))) ... + (unless heartbeat-cancel? + (http-request (current-heartbeat-url)))) +(export-syntax heartbeat) |