shepherd: cron-string->calendar-event does not seem to work

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 months ago
(address . bug-guix@gnu.org)
87lduyhfw6.fsf@wolfsden.cz
Five asterisks (* * * * *) is a valid cron time specification, but
cron-string->calendar-event chokes one it:

Toggle snippet (24 lines)
$ guix shell guile shepherd guile-fibers -- guile -c '(use-modules (shepherd service timer)) (cron-string->calendar-event "* * * * *")'
Backtrace:
In ice-9/boot-9.scm:
1752:10 7 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
6 (apply-smob/0 #<thunk 7f8d870d7300>)
In ice-9/boot-9.scm:
724:2 5 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 4 (_ #(#(#<directory (guile-user) 7f8d870dac80>)))
In ice-9/command-line.scm:
185:19 3 (_ #<input: string 7f8d870d4850>)
In unknown file:
2 (eval (cron-string->calendar-event "* * * * *") #<direc…>)
In shepherd/service/timer.scm:
155:2 1 (calendar-event #:seconds _ #:minutes _ #:hours _ # _ # …)
In srfi/srfi-1.scm:
634:9 0 (for-each #<procedure 7f8d7f382a80 at shepherd/service…> …)

srfi/srfi-1.scm:634:9: In procedure for-each:
ERROR:
1. &message: "calendar-event: hours: 24: value out of range (0-23)"

I *think* on line 450 in timer.scm there should be `(hours 24 0)'
instead of the current `(hours 60 0)'.

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmeVNkkOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wan7tRAAuP0k3pWnHM/V49BzXQD7TaREtqm8SbbypzED
PFV0NM3RYzoGhtu4ONdAMD69ELufAHGa/1F44f/W7mri4fNIvRQab+U9CGIDGgL+
4qck+yOq7b9NN5cIKo2AhWmGT2qIloPB3iLxUPytE8gCuzSaNsLWYgwyieasi5hL
oggnXEnycQAJwdnbe5GH/mA8c8CEIUzkGc+qaXuWJU2RGvdVt5KkRUci1ikw8oMm
9oZLD9Gb0F9QmW6EbndyW3Ea5tjAQCtXhscTuZCk5yFkC7bYxnNi5PV3dBNHU9pT
mQjjWfJbvXxeoTimtV2U2GF5V/eZn8JO/dYIZ6cuMJxyl960edhZ8ZjmN3HVQibs
f+Wlk4qRFSx5Jvr1PrCHN7P/n7FwmBWvRm5SMOXaKLBvZM8fFOxm5fw3ZU04SOAz
i9dnMpSZjbSgGp9gagUHRHcd+x3wbPhA8oRMUO0EIDqK2i8usyny0Aw0jArEL++o
rJltokbyhNdWs6UW808zmZ3Hc5/lYBjQLFJZPZtsnDWLtPUGLQ4qCfNjXw7IfhTR
l0I1y7QVvQ36qwF2FFHeLfhlwpYQIwWIIxjeYqm6SQG2XP/7w0G5tSyOivMt/Bk+
c+npuTbEenqxx4WsgM4iypuxqcudJ15Ks8L/lE+bRJVHDk6WWeqp4HwsgMFyqCiH
qgA5bZc=
=0Fgi
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 4 weeks ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 75836-done@debbugs.gnu.org)
87o6zga2ok.fsf@gnu.org
Hello,

Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (2 lines)
> $ guix shell guile shepherd guile-fibers -- guile -c '(use-modules (shepherd service timer)) (cron-string->calendar-event "* * * * *")'

[...]

Toggle quote (5 lines)
> 1. &message: "calendar-event: hours: 24: value out of range (0-23)"
>
> I *think* on line 450 in timer.scm there should be `(hours 24 0)'
> instead of the current `(hours 60 0)'.

Indeed. Fixed in Shepherd commit
e23044715b14dae3158926a49b771fd5862d65db.

Thanks!

Ludo’.
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75836@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75836
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help