Skip to content

Commit

Permalink
Always perform a first run immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
dschanoeh committed Jun 13, 2022
1 parent c96acca commit e68ed0a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hover-ddns.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ func main() {
os.Exit(1)
}

// When a dry run is requested, scheduling will be ignored and a single
// run will be executed immediately.
// Perform a first run immediately
log.Info("Performing first update")
run(&config, provider, dryRun, manualV4, manualV6)

// If a dry-run was requested, we're done now and can terminate
if *dryRun {
run(&config, provider, dryRun, manualV4, manualV6)
return
}

Expand All @@ -121,6 +123,7 @@ func main() {
os.Exit(1)
}
cronScheduler.Start()
log.Info("Waiting for future scheduled updates")

// We'll wait here until we receive a signal
c := make(chan os.Signal, 1)
Expand Down

0 comments on commit e68ed0a

Please sign in to comment.