Skip to content

Commit

Permalink
Use only one sqlite connection.
Browse files Browse the repository at this point in the history
This fixes #263.
  • Loading branch information
xiaq committed Oct 13, 2016
1 parent ed30289 commit 89347df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ type Store struct {
func DefaultDB(dbname string) (*sql.DB, error) {
uri := "file:" + url.QueryEscape(dbname) +
"?mode=rwc&cache=shared&vfs=unix-dotfile"
return sql.Open("sqlite3", uri)
db, err := sql.Open("sqlite3", uri)
if err == nil {
db.SetMaxOpenConns(1)
}
return db, err
}

// NewStore creates a new Store with the default database.
Expand Down

0 comments on commit 89347df

Please sign in to comment.