Explicitly close connection to SQLite on failed upgrade
This commit is contained in:
parent
8adf65ade2
commit
4dce5a91c9
@ -150,6 +150,7 @@ func OpenSqliteDB(driver, source string) (Database, error) {
|
|||||||
|
|
||||||
db := &SqliteDB{db: sqlSqliteDB}
|
db := &SqliteDB{db: sqlSqliteDB}
|
||||||
if err := db.upgrade(); err != nil {
|
if err := db.upgrade(); err != nil {
|
||||||
|
sqlSqliteDB.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user