Oops, don't kill Gosora when the Unix socket isn't present.

This commit is contained in:
Azareal 2018-08-29 11:59:43 +10:00
parent 63451c7291
commit c20251b462
1 changed files with 3 additions and 5 deletions

View File

@ -57,12 +57,10 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error
}
db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true")
if err != nil {
return db, err
if err == nil {
// Make sure that the connection is alive
return db, db.Ping()
}
// Make sure that the connection is alive
return db, db.Ping()
}
// Open the database connection