Add aggregator to watcher
This commit is contained in:
parent
fbd9d80b96
commit
de2ea4ed9d
@ -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
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user