diff options
author | Audrius Butkevicius <github@audrius.rocks> | 2021-05-11 07:02:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 08:02:19 +0200 |
commit | a8e2fc6f61cc0674ee3f9576abc0f4a52f0b86d9 (patch) | |
tree | b2c35dea07d6fa0d8c0bffe9565bd9d8d56b5b7a | |
parent | aca1b45e938eb59e350f082a0a34aadeb01bd65b (diff) |
cmd/uraggregate: Handle malformed data, dont abort on error (fixes #7639) (#7659)v1.17.0-rc.1
-rw-r--r-- | cmd/uraggregate/main.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cmd/uraggregate/main.go b/cmd/uraggregate/main.go index 05ce7a7b83..44cbe881bc 100644 --- a/cmd/uraggregate/main.go +++ b/cmd/uraggregate/main.go @@ -49,30 +49,30 @@ func runAggregation(db *sql.DB) { log.Println("Aggregating VersionSummary data since", since) rows, err := aggregateVersionSummary(db, since) if err != nil { - log.Fatalln("aggregate:", err) + log.Println("aggregate:", err) } log.Println("Inserted", rows, "rows") log.Println("Aggregating UserMovement data") rows, err = aggregateUserMovement(db) if err != nil { - log.Fatalln("aggregate:", err) + log.Println("aggregate:", err) } log.Println("Inserted", rows, "rows") - log.Println("Aggregating Performance data") since = maxIndexedDay(db, "Performance") + log.Println("Aggregating Performance data since", since) rows, err = aggregatePerformance(db, since) if err != nil { - log.Fatalln("aggregate:", err) + log.Println("aggregate:", err) } log.Println("Inserted", rows, "rows") - log.Println("Aggregating BlockStats data") since = maxIndexedDay(db, "BlockStats") + log.Println("Aggregating BlockStats data since", since) rows, err = aggregateBlockStats(db, since) if err != nil { - log.Fatalln("aggregate:", err) + log.Println("aggregate:", err) } log.Println("Inserted", rows, "rows") } @@ -198,7 +198,8 @@ func aggregateUserMovement(db *sql.DB) (int64, error) { Report->>'uniqueID' FROM ReportsJson WHERE - DATE_TRUNC('day', Received) < DATE_TRUNC('day', NOW()) + Report->>'uniqueID' IS NOT NULL + AND DATE_TRUNC('day', Received) < DATE_TRUNC('day', NOW()) AND Report->>'version' like 'v_.%' ORDER BY Day `) |