diff options
Diffstat (limited to 'tojo-tokyo')
-rw-r--r-- | tojo-tokyo/monitoring.scm | 8 |
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) |