Replaced repositories.Bundle with a database interface.
the build was successful

This commit is contained in:
2019-06-16 11:39:33 +02:00
parent 021f67ea4b
commit f6ad0602c2
6 changed files with 73 additions and 35 deletions
+5 -5
View File
@@ -28,17 +28,17 @@ func main() {
log.Fatalln("Failed to init store:", err)
}
repos, stopFn, err := database.Init(config.Global().Database)
db, err := database.Init(config.Global().Database)
if err != nil {
log.Fatalln("Failed to init db:", err)
}
defer stopFn()
services := services.NewBundle(repos)
defer db.Close(context.Background())
serviceBundle := services.NewBundle(db)
instrumentation.Register()
http.Handle("/", handler.Playground("RPData API", "/graphql"))
http.Handle("/graphql", queryHandler(services))
http.Handle("/graphql", queryHandler(serviceBundle))
http.Handle("/metrics", promhttp.Handler())
@@ -51,7 +51,7 @@ func main() {
log.Println("Characters updated")
}()
go logListedChanges(services.Changes)
go logListedChanges(serviceBundle.Changes)
log.Fatal(http.ListenAndServe(":8081", nil))
}