Re: [PATCH 6/6] maintenance: use random minute in systemd scheduler
From: Taylor Blau <hidden>
Date: 2023-08-08 20:37:39
On Tue, Aug 08, 2023 at 09:49:40AM -0400, Derrick Stolee wrote:
quoted
But I figured I'd raise the question in case you did mean for them to both run on either Sunday or Monday.I don't intend to change the day that is run as part of this change. I think all other schedulers run on Sunday, but systemd running on Monday is a particular detail of its "weekly" schedule.
No problem -- I figured that you didn't intend on changing the days around here, just wanted to make sure it was known that the systemd scheduler picks a different day of the week for its weekly schedule than the others do.
quoted
quoted
-static int systemd_timer_write_unit_templates(const char *exec_path) +static int systemd_timer_write_unit_template(enum schedule_priority schedule, + const char *exec_path, + int minute) { char *filename; FILE *file; const char *unit; + char *schedule_pattern = NULL;You should be able to drop the NULL initialization, since you assign this value unconditionally in the switch statement below (or BUG() on an unknown schedule type).Unfortunately, GCC complained about a possibly-unassigned value when I left this unset during development, so this actually is necessary for that compiler.
Ah, I would have thought that GCC would be smart enough to figure out that schedule_pattern is unconditionally initialized via the switch statement, but I guess not. Makes sense. Thanks, Taylor