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

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

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Assume the MySQL password is "" when running locally Created 5 years, 11 months 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
« no previous file with comments | « perf/go/db/db_test.go ('k') | perf/go/perf_migratedb/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: perf/go/ingest/main.go
diff --git a/perf/go/ingest/main.go b/perf/go/ingest/main.go
index ebf9937087f50d6d6a133a564e2ed909ad2f60bd..7ffa1cddb135a1a60aa78ba9b585b21c51f1af2d 100644
--- a/perf/go/ingest/main.go
+++ b/perf/go/ingest/main.go
@@ -13,6 +13,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"
@@ -73,13 +74,19 @@ func NewIngestionProcess(git *gitinfo.GitInfo, tileDir, datasetName string, ri i
}
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)
// 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)
« no previous file with comments | « 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