From 995c8b9565095fcd20e6cd89d65eb2605e098d15 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Thu, 2 May 2019 09:53:12 -0400 Subject: [PATCH] fix time windows for aggregate activity --- activity/aggregate/activity.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activity/aggregate/activity.go b/activity/aggregate/activity.go index b9ba83f..2b79c4e 100755 --- a/activity/aggregate/activity.go +++ b/activity/aggregate/activity.go @@ -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: