Skip to content

Commit

Permalink
fix(core): temporary fix thread safety
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Aug 19, 2018
1 parent 0874e78 commit 4f7d224
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/sql/sqlcipher/sqlcipher.go
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/jinzhu/gorm"
"github.com/pkg/errors"

// sqlcipher blank import
_ "github.com/xeodou/go-sqlcipher"
)
Expand All @@ -22,7 +21,9 @@ func Open(source interface{}, key []byte) (*gorm.DB, error) {
if err != nil {
return nil, errors.Wrap(err, "failed to initialize a new gorm connection")
}

// FIXME: is here to avoid file is not a database
db.DB().SetMaxIdleConns(1)
db.DB().SetMaxOpenConns(1)
// disable logger to prevent printing warns that are already returned
db.LogMode(false)

Expand Down

0 comments on commit 4f7d224

Please sign in to comment.