1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Add database cleanup functionality.

This commit is contained in:
Ferdinand Mütsch
2020-03-09 17:30:23 +01:00
parent c7556fa9a5
commit 33ebb8a771
5 changed files with 48 additions and 5 deletions

View File

@ -11,7 +11,7 @@ import (
)
const (
intervalDays int = 1 // TODO: Make configurable
aggregateIntervalDays int = 1 // TODO: Make configurable
)
type AggregationService struct {
@ -126,7 +126,7 @@ func generateUserJobs(userId string, lastAggregation time.Time, jobs chan<- *Agg
from = time.Date(
lastAggregation.Year(),
lastAggregation.Month(),
lastAggregation.Day()+intervalDays,
lastAggregation.Day()+aggregateIntervalDays,
0, 0, 0, 0,
lastAggregation.Location(),
)
@ -136,7 +136,7 @@ func generateUserJobs(userId string, lastAggregation time.Time, jobs chan<- *Agg
to = time.Date(
from.Year(),
from.Month(),
from.Day()+intervalDays,
from.Day()+aggregateIntervalDays,
0, 0, 0, 0,
from.Location(),
)