Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Nov 6, 2024
1 parent 95acd04 commit d25cd28
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions go/vt/vtorc/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,17 @@ func OpenVTOrc() (*sqlx.DB, error) {
defer sqliteDBMu.Unlock()

var err error
var exists bool
if sqliteDB != nil {
exists = true
} else {
var created bool
if sqliteDB == nil {
sqliteDB, err = sqlx.Connect("sqlite", config.Config.SQLite3DataFile)
if err == nil {
created = true
}
}

if err == nil && !exists {
if created {
log.Infof("Connected to vtorc backend: sqlite on %v", config.Config.SQLite3DataFile)
_ = initVTOrcDB(sqliteDB)
}
if sqliteDB != nil {
sqliteDB.SetMaxOpenConns(1)
sqliteDB.SetMaxIdleConns(1)
}
Expand Down

0 comments on commit d25cd28

Please sign in to comment.