mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
fix: remove unnecessary cronSet check
resolves issue 343
This commit is contained in:
parent
b4846ef158
commit
9eca883f17
1 changed files with 2 additions and 3 deletions
|
|
@ -65,13 +65,12 @@ func PreRun(cmd *cobra.Command, args []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pollingSet := f.Changed("interval")
|
pollingSet := f.Changed("interval")
|
||||||
cronSet := f.Changed("schedule")
|
|
||||||
schedule, _ := f.GetString("schedule")
|
schedule, _ := f.GetString("schedule")
|
||||||
cronLen := len(schedule)
|
cronLen := len(schedule)
|
||||||
|
|
||||||
if pollingSet && cronSet && cronLen > 0 {
|
if pollingSet && cronLen > 0 {
|
||||||
log.Fatal("Only schedule or interval can be defined, not both.")
|
log.Fatal("Only schedule or interval can be defined, not both.")
|
||||||
} else if cronSet && cronLen > 0 {
|
} else if cronLen > 0 {
|
||||||
scheduleSpec, _ = f.GetString("schedule")
|
scheduleSpec, _ = f.GetString("schedule")
|
||||||
} else {
|
} else {
|
||||||
interval, _ := f.GetInt("interval")
|
interval, _ := f.GetInt("interval")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue