Humanize restart interval

This commit is contained in:
C. McEnroe 2020-10-20 19:55:11 -04:00
parent 324f569ce0
commit 1832301862
1 changed files with 4 additions and 4 deletions

View File

@ -155,8 +155,8 @@ void serviceStatus(struct Service *service) {
struct timespec timeleft; struct timespec timeleft;
timespecsub(&service->restartDeadline, &now, &timeleft); timespecsub(&service->restartDeadline, &now, &timeleft);
syslog( syslog(
LOG_NOTICE, "%s[] is restarting in %ds", LOG_NOTICE, "%s[] is restarting in %s",
service->name, (int)timeleft.tv_sec service->name, humanize(timeleft)
); );
} else if (service->state == Stop && service->intent == Restart) { } else if (service->state == Stop && service->intent == Restart) {
syslog(LOG_NOTICE, "%s[] is restarting", service->name); syslog(LOG_NOTICE, "%s[] is restarting", service->name);
@ -349,8 +349,8 @@ void serviceReap(pid_t pid, int status) {
} }
setDeadline(service); setDeadline(service);
syslog( syslog(
LOG_NOTICE, "%s[%d] restarting in %ds", LOG_NOTICE, "%s[%d] restarting in %s",
service->name, pid, (int)service->restartInterval.tv_sec service->name, pid, humanize(service->restartInterval)
); );
} else { } else {
syslog(LOG_NOTICE, "%s[%d] stopped", service->name, pid); syslog(LOG_NOTICE, "%s[%d] stopped", service->name, pid);