Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: perf/go/ingest/main.go

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Fix newline in password Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: perf/go/ingest/main.go
diff --git a/perf/go/ingest/main.go b/perf/go/ingest/main.go
index cb4aa2e34a947e95681b75fec435f05375ab6183..e22ca9b4774026248c9b8f8f94a2cea27a117824 100644
--- a/perf/go/ingest/main.go
+++ b/perf/go/ingest/main.go
@@ -16,6 +16,7 @@ import (
"github.com/golang/glog"
"skia.googlesource.com/buildbot.git/go/auth"
"skia.googlesource.com/buildbot.git/go/common"
+ "skia.googlesource.com/buildbot.git/go/database"
"skia.googlesource.com/buildbot.git/go/gitinfo"
"skia.googlesource.com/buildbot.git/perf/go/config"
"skia.googlesource.com/buildbot.git/perf/go/db"
@@ -139,15 +140,21 @@ func NewIngestionProcess(ts *Timestamps, tsName string, git *gitinfo.GitInfo, ti
}
func main() {
+ // Setup DB flags.
+ database.SetupFlags(db.PROD_DB_HOST, db.PROD_DB_PORT, database.USER_RW, db.PROD_DB_NAME)
+
common.InitWithMetrics("ingest", *graphiteServer)
goldingester.Init(*fileCacheDir)
// Initialize the database. We might not need the oauth dialog if it fails.
- db.Init(db.ProdDatabaseConfig(*local))
+ conf, err := database.ConfigFromFlagsAndMetadata(*local, db.MigrationSteps())
+ if err != nil {
+ glog.Fatal(err)
+ }
+ db.Init(conf)
var client *http.Client
- var err error
if *doOauth {
config := auth.DefaultOAuthConfig(*oauthCacheFile)
client, err = auth.RunFlow(config)
« perf/DESIGN.md ('K') | « perf/go/db/db_test.go ('k') | perf/go/perf_migratedb/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698