Skip to content

Commit

Permalink
fix time windows for aggregate activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Martinez committed May 2, 2019
1 parent 820315d commit 995c8b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activity/aggregate/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ func (a *Activity) createWindow(ctx activity.Context) (w window.Window, err erro
w, err = NewSlidingWindow(settings.Function, windowSettings)
case "timetumbling":
w, err = NewTumblingTimeWindow(settings.Function, windowSettings)
if err != nil && timerSupported {
if err == nil && timerSupported {
err = timerSupport.CreateTimer(time.Duration(settings.WindowSize)*time.Millisecond, a.moveWindow, true)
}
case "timesliding":
w, err = NewSlidingTimeWindow(settings.Function, windowSettings)
if err != nil && timerSupported {
if err == nil && timerSupported {
err = timerSupport.CreateTimer(time.Duration(settings.Resolution)*time.Millisecond, a.moveWindow, true)
}
default:
Expand Down

0 comments on commit 995c8b9

Please sign in to comment.