Use atomic.LoadInt32/AddInt32 for database subsystem (#412)

This commit is contained in:
Adrian Gallagher
2020-01-14 10:27:26 +11:00
committed by GitHub
parent 12159e36fa
commit 26b8e95eb0
2 changed files with 19 additions and 11 deletions

View File

@@ -30,13 +30,13 @@ func openDbConnection(driver string) (err error) {
if driver == database.DBPostgreSQL {
dbConn, err = dbPSQL.Connect()
if err != nil {
return fmt.Errorf("database failed to connect: %v Some features that utilise a database will be unavailable", err)
return fmt.Errorf("database failed to connect: %v, some features that utilise a database will be unavailable", err)
}
return nil
} else if driver == database.DBSQLite || driver == database.DBSQLite3 {
dbConn, err = dbsqlite3.Connect()
if err != nil {
return fmt.Errorf("database failed to connect: %v Some features that utilise a database will be unavailable", err)
return fmt.Errorf("database failed to connect: %v, some features that utilise a database will be unavailable", err)
}
return nil
}