Skip to content

Commit

Permalink
finalize index replay service.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Apr 26, 2022
1 parent b4a6dcd commit d9e3430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/influxMigration/indexReplay/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/diadata-org/diadata/influxMigration/indexReplay
go 1.14

require (
github.com/diadata-org/diadata v1.4.1-rc-134
github.com/diadata-org/diadata v1.4.1-rc-135
github.com/sirupsen/logrus v1.8.1
)
16 changes: 8 additions & 8 deletions cmd/influxMigration/indexReplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ func processIndexVals(timeInit, timeFinal time.Time, stepSize int64, indexSymbol
currIndexValue := models.GetIndexValue(indexSymbol, constituents)
computePercentages(indexSymbol, &constituents, currIndexValue)
for j := range constituents {
// err = ds.SetCryptoIndexConstituent(&constituents[j], oldIndexVals[i].Asset, oldIndexVals[i].CalculationTime)
// if err != nil {
// log.Error("set crypto index constituent: ", err)
// }
err = ds.SetCryptoIndexConstituent(&constituents[j], oldIndexVals[i].Asset, oldIndexVals[i].CalculationTime)
if err != nil {
log.Error("set crypto index constituent: ", err)
}

log.Infof("set constituent at time %v: %v", oldIndexVals[i].CalculationTime, constituents[j])
}
Expand All @@ -246,10 +246,10 @@ func processIndexVals(timeInit, timeFinal time.Time, stepSize int64, indexSymbol
index := indexValueCalculation(constituents, oldIndexVals[i], indexValue, ds)

// Save index.
// err = ds.SetCryptoIndex(&index)
// if err != nil {
// log.Error(err)
// }
err = ds.SetCryptoIndex(&index)
if err != nil {
log.Error(err)
}
log.Infof("set crypto index at calculation time %v: value, divisor, price -- %v, %v, %v ", index.CalculationTime, index.Value, index.Divisor, index.Price)
log.Infof("set crypto index at calculation time %v: value/divisor -- %v,", index.CalculationTime, index.Value/index.Divisor)

Expand Down

0 comments on commit d9e3430

Please sign in to comment.