Skip to content

Commit

Permalink
exit on error
Browse files Browse the repository at this point in the history
  • Loading branch information
orvice committed Jun 17, 2024
1 parent 3625ca2 commit 8d2cd31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/ddns/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ func main() {
ctx := context.Background()

task.NewTaskAndRun("updateUpdate", time.Minute*3, func() error {
return updateIP(ctx)
err := updateIP(ctx)
if err != nil {
slog.Error("update ip error", "error", err.Error())
os.Exit(1)
}
return err
}, task.SetTaskLogger(log.GetDefault()))
select {}
}
Expand Down

0 comments on commit 8d2cd31

Please sign in to comment.