fix: remove unnecessary cronSet check

resolves issue 343
pull/336/head v0.3.8
Simon Aronsson 5 years ago
parent b4846ef158
commit 9eca883f17

@ -65,13 +65,12 @@ func PreRun(cmd *cobra.Command, args []string) {
}
pollingSet := f.Changed("interval")
cronSet := f.Changed("schedule")
schedule, _ := f.GetString("schedule")
cronLen := len(schedule)
if pollingSet && cronSet && cronLen > 0 {
if pollingSet && cronLen > 0 {
log.Fatal("Only schedule or interval can be defined, not both.")
} else if cronSet && cronLen > 0 {
} else if cronLen > 0 {
scheduleSpec, _ = f.GetString("schedule")
} else {
interval, _ := f.GetInt("interval")

Loading…
Cancel
Save