Skip to content

Commit

Permalink
Set default period to 600 seconds for periodic instructions (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Kim <[email protected]>
  • Loading branch information
Oats87 authored Feb 8, 2022
1 parent bd24a48 commit 559b615
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/applyinator/applyinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ func (a *Applyinator) Apply(ctx context.Context, input ApplyInput) (ApplyOutput,
if err != nil {
logrus.Errorf("error encountered during parsing of last run time: %v", err)
} else {
if instruction.PeriodSeconds == 0 {
instruction.PeriodSeconds = 600 // set default period to 600 seconds
}
if now.Before(t.Add(time.Second * time.Duration(instruction.PeriodSeconds))) {
logrus.Debugf("[Applyinator] Not running periodic instruction %s as period duration has not elapsed since last run", instruction.Name)
continue
Expand Down

0 comments on commit 559b615

Please sign in to comment.