aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2021-09-10 23:26:15 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2021-09-10 23:29:54 +0900
commit99db62631519918663f4754f93ebf6bba7ddd6a8 (patch)
treeb8146160406e6c1f4b865cf97ea9f5f8335152f6
parent0c274cc17f4507b0e6dd239a2f970ef3475e003e (diff)
monitoring: Change heartbeat procedure to syntax.v0.1.1
-rw-r--r--configure.ac2
-rw-r--r--guix.scm2
-rw-r--r--tojo-tokyo/monitoring.scm8
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])
diff --git a/guix.scm b/guix.scm
index d8c45aa..5f4d6d1 100644
--- a/guix.scm
+++ b/guix.scm
@@ -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)