[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/08: timer: ‘trigger’ action prints a hint when passed #f.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/08: timer: ‘trigger’ action prints a hint when passed #f. |
Date: |
Fri, 9 Aug 2024 17:12:32 -0400 (EDT) |
civodul pushed a commit to branch devel
in repository shepherd.
commit ca4976a846860e594c20c49b711431c6a48d8f86
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Aug 9 16:37:19 2024 +0200
timer: ‘trigger’ action prints a hint when passed #f.
* modules/shepherd/service/timer.scm (trigger-timer): Print a hint when
TIMER is #f.
---
modules/shepherd/service/timer.scm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules/shepherd/service/timer.scm
b/modules/shepherd/service/timer.scm
index 4473676..507a71b 100644
--- a/modules/shepherd/service/timer.scm
+++ b/modules/shepherd/service/timer.scm
@@ -715,8 +715,15 @@ constructor was given by @code{make-timer-destructor}."
(define (trigger-timer timer)
"Trigger the action associated with @var{timer} as if it had reached its
next calendar event."
- (local-output (l10n "Triggering timer."))
- (put-message (timer-channel timer) 'timeout))
+ (if timer
+ (begin
+ (local-output (l10n "Triggering timer."))
+ (put-message (timer-channel timer) 'timeout))
+
+ ;; Properly report situations like 'herd trigger S' when S is stopped
+ ;; and thus has a running value of #f.
+ (local-output (l10n "Attempted to trigger a timer that is not running; \
+doing nothing."))))
(define timer-trigger-action
(action 'trigger trigger-timer
- [shepherd] branch devel updated (a43ae34 -> 1f5fdf7), Ludovic Courtès, 2024/08/09
- [shepherd] 01/08: logger: Change ‘file’ to ‘files’ (plural)., Ludovic Courtès, 2024/08/09
- [shepherd] 02/08: system-log: Turn dispatcher into a proper logger., Ludovic Courtès, 2024/08/09
- [shepherd] 04/08: timer: ‘trigger’ action prints a hint when passed #f.,
Ludovic Courtès <=
- [shepherd] 05/08: tests: Ensure ‘log-rotation’ is not trigger automatically., Ludovic Courtès, 2024/08/09
- [shepherd] 07/08: system-log: Use ‘log-line’ from (shepherd logger)., Ludovic Courtès, 2024/08/09
- [shepherd] 08/08: system-log: Keep recent messages in a ring buffer., Ludovic Courtès, 2024/08/09
- [shepherd] 06/08: system-log: Implement log rotation., Ludovic Courtès, 2024/08/09
- [shepherd] 03/08: logger: Factorize ‘rotate-and-reopen-log-file’., Ludovic Courtès, 2024/08/09