run the aggregator every minute since we only need the last pageview of every visitor for determining distinct realtime visitor count

This commit is contained in:
Danny 2018-05-09 10:36:05 +02:00
parent b5d5996c90
commit e73a205d26
2 changed files with 3 additions and 2 deletions

View File

@ -83,10 +83,10 @@ func NewCollectHandler() http.Handler {
})
}
// runs the aggregate func every 5 mins
// runs the aggregate func every minute
func aggregate() {
counter.Aggregate()
timeout := 5 * time.Minute
timeout := 1 * time.Minute
for {
select {

View File

@ -13,6 +13,7 @@ func Aggregate() error {
// Get unprocessed pageviews
pageviews, err := datastore.GetProcessablePageviews()
if err != nil && err != datastore.ErrNoResults {
log.Error(err)
return err
}