Add aggregator to watcher

This commit is contained in:
Kevin Cotugno 2017-10-10 09:55:25 -07:00
parent fbd9d80b96
commit de2ea4ed9d
2 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,8 @@ import (
"github.com/kcotugno/tacitus/ops"
"github.com/kcotugno/tacitus/osutil"
"github.com/kcotugno/tacitus/postgres"
"time"
)
func main() {
@ -35,6 +37,12 @@ func main() {
return
}
a := ops.Aggregator{}
a.Database = db
a.Logger = logger
a.Products = []string{"ETH-USD", "BTC-USD"}
a.Start(30 * time.Second)
v := validator{}
v.db = db
v.logger = logger

View File

@ -83,6 +83,8 @@ func (a *Aggregator) aggregate(product string, interval time.Duration) {
if err != nil {
a.Logger.Info(`aggregator: database error="%v"`, err)
}
a.Logger.Info(`aggregator: DONE product="%v" interval="%v"`, product, interval)
}
func (a *Aggregator) Stop() {