Skip to content

Commit

Permalink
Remove some DB instantiation code since we're using memory catalog fo…
Browse files Browse the repository at this point in the history
…r now
  • Loading branch information
beggers committed Oct 27, 2023
1 parent 42c4701 commit 8793571
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions go/coordinator/internal/grpccoordinator/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/chroma/chroma-coordinator/internal/coordinator"
"github.com/chroma/chroma-coordinator/internal/grpccoordinator/grpcutils"
"github.com/chroma/chroma-coordinator/internal/metastore/db/dbcore"
"github.com/chroma/chroma-coordinator/internal/proto/coordinatorpb"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
Expand Down Expand Up @@ -40,19 +39,19 @@ type Server struct {
}

func New(config Config) (*Server, error) {
dBConfig := dbcore.DBConfig{
Username: config.Username,
Password: config.Password,
Address: config.Address,
DBName: config.DBName,
MaxIdleConns: config.MaxIdleConns,
MaxOpenConns: config.MaxOpenConns,
}
db, err := dbcore.Connect(dBConfig)
if err != nil {
return nil, err
}
return NewWithGrpcProvider(config, grpcutils.Default, db)
// dBConfig := dbcore.DBConfig{
// Username: config.Username,
// Password: config.Password,
// Address: config.Address,
// DBName: config.DBName,
// MaxIdleConns: config.MaxIdleConns,
// MaxOpenConns: config.MaxOpenConns,
// }
// db, err := dbcore.Connect(dBConfig)
// if err != nil {
// return nil, err
// }
return NewWithGrpcProvider(config, grpcutils.Default, nil)
}

func NewWithGrpcProvider(config Config, provider grpcutils.GrpcProvider, db *gorm.DB) (*Server, error) {
Expand Down

0 comments on commit 8793571

Please sign in to comment.