Fix the empty route errors.

Updates #53
This commit is contained in:
Azareal 2019-07-12 07:26:05 +10:00
parent 13fa2326bd
commit 101b1c51df
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import (
"sync/atomic"
"github.com/Azareal/Gosora/common"
"github.com/Azareal/Gosora/query_gen"
qgen "github.com/Azareal/Gosora/query_gen"
)
// TODO: Rename this?
@ -22,7 +22,7 @@ type DefaultViewCounter struct {
func NewGlobalViewCounter(acc *qgen.Accumulator) (*DefaultViewCounter, error) {
counter := &DefaultViewCounter{
currentBucket: 0,
insert: acc.Insert("viewchunks").Columns("count, createdAt").Fields("?,UTC_TIMESTAMP()").Prepare(),
insert: acc.Insert("viewchunks").Columns("count, createdAt, route").Fields("?,UTC_TIMESTAMP(),''").Prepare(),
}
common.AddScheduledFifteenMinuteTask(counter.Tick) // This is run once every fifteen minutes to match the frequency of the RouteViewCounter
//common.AddScheduledSecondTask(counter.Tick)