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

chore: make aggregation time configurable (resolve #60)

This commit is contained in:
Ferdinand Mütsch
2020-10-16 16:21:13 +02:00
parent a4c344aaa1
commit 177cbb12fc
3 changed files with 3 additions and 2 deletions

View File

@ -40,7 +40,6 @@ type AggregationJob struct {
}
// Schedule a job to (re-)generate summaries every day shortly after midnight
// TODO: Make configurable
func (srv *AggregationService) Schedule() {
jobs := make(chan *AggregationJob)
summaries := make(chan *models.Summary)
@ -58,7 +57,7 @@ func (srv *AggregationService) Schedule() {
// Run once initially
srv.trigger(jobs)
gocron.Every(1).Day().At("02:15").Do(srv.trigger, jobs)
gocron.Every(1).Day().At(srv.Config.App.AggregationTime).Do(srv.trigger, jobs)
<-gocron.Start()
}