aboutsummaryrefslogtreecommitdiff
path: root/tojo-tokyo
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 /tojo-tokyo
parent0c274cc17f4507b0e6dd239a2f970ef3475e003e (diff)
monitoring: Change heartbeat procedure to syntax.v0.1.1
Diffstat (limited to 'tojo-tokyo')
-rw-r--r--tojo-tokyo/monitoring.scm8
1 files changed, 6 insertions, 2 deletions
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)