Skip to content

Commit

Permalink
refactor: rename var mysql* to sql*
Browse files Browse the repository at this point in the history
The current variable name `mysqlStore` and `mysqlStoreCh` can generate
confusion as it comes from a factory store that support multiple
databases (MySQL and Postgres).

Signed-off-by: Kairo de Araujo <[email protected]>
  • Loading branch information
kairoaraujo committed Jan 10, 2024
1 parent 34d9180 commit 3cc15de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/archivista/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func main() {
logrus.Fatalf("could not create ent client: %+v", err)
}

mysqlStore, mysqlStoreCh, err := sqlstore.New(ctx, entClient)
sqlStore, sqlStoreCh, err := sqlstore.New(ctx, entClient)
if err != nil {
logrus.Fatalf("error initializing mysql client: %+v", err)
}
Expand All @@ -108,13 +108,13 @@ func main() {
logrus.Infof("executing phase 3: create and register http service (time since start: %s)", time.Since(startTime))
// ********************************************************************************
now = time.Now()
server := server.New(mysqlStore, fileStore)
server := server.New(sqlStore, fileStore)
router := mux.NewRouter()
router.HandleFunc("/download/{gitoid}", server.GetHandler)
router.HandleFunc("/upload", server.StoreHandler)

if cfg.EnableGraphql {
client := mysqlStore.GetClient()
client := sqlStore.GetClient()
srv := handler.NewDefaultServer(archivista.NewSchema(client))
srv.Use(entgql.Transactioner{TxOpener: client})
router.Handle("/query", srv)
Expand Down Expand Up @@ -156,7 +156,7 @@ func main() {

<-ctx.Done()
<-fileStoreCh
<-mysqlStoreCh
<-sqlStoreCh

logrus.Infof("exiting, uptime: %v", time.Since(startTime))
}
Expand Down

0 comments on commit 3cc15de

Please sign in to comment.