Skip to content

Commit

Permalink
fix: print out something in the quiet mode (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Mar 15, 2023
1 parent c8083e9 commit a1f7d07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cmd/ddns/ddns.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,19 @@ func realMain() int { //nolint:funlen
c.Monitor.Failure(ctx, ppfmt, msg)
}
}
first = false

// Maybe the cron was disabled?
// Check if cron was disabled
if c.UpdateCron == nil {
ppfmt.Infof(pp.EmojiBye, "Bye!")
return 0
} else if first && !ppfmt.IsEnabledFor(pp.Verbose) {
// Currently, the quiet mode is too quiet, and some system (Raspberry Pi 4) is not happy
// with empty log. As a workaround, we will print a Notice here. See #426.
ppfmt.Noticef(pp.EmojiRepeat, "Enabled cron schedule for %s", formatName())
}

first = false

// Maybe there's nothing scheduled in near future?
if next.IsZero() {
ppfmt.Errorf(pp.EmojiUserError, "No scheduled updates in near future")
Expand Down
2 changes: 1 addition & 1 deletion internal/pp/emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
EmojiClearRecord Emoji = "馃Ч" // clearing DNS records

EmojiNotification Emoji = "馃敂" // sending out notifications, pinging, health checks
EmojiRepeatOnce Emoji = "馃攤" // repeating things once
EmojiRepeat Emoji = "馃攣" // repeating things

EmojiSignal Emoji = "馃毃" // catching signals
EmojiAlreadyDone Emoji = "馃し" // DNS records were already up to date
Expand Down

0 comments on commit a1f7d07

Please sign in to comment.