3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00

Merge pull request #303 from enckse/master

prevents default create/open of buntdb, requires user to call initdb
This commit is contained in:
Shivaram Lingamneni 2018-11-19 14:23:03 -05:00 committed by GitHub
commit 70364f5f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,10 @@ func OpenDatabase(config *Config) (*buntdb.DB, error) {
// open the database, giving it at most one chance to auto-upgrade the schema // open the database, giving it at most one chance to auto-upgrade the schema
func openDatabaseInternal(config *Config, allowAutoupgrade bool) (db *buntdb.DB, err error) { func openDatabaseInternal(config *Config, allowAutoupgrade bool) (db *buntdb.DB, err error) {
_, err = os.Stat(config.Datastore.Path)
if os.IsNotExist(err) {
return
}
db, err = buntdb.Open(config.Datastore.Path) db, err = buntdb.Open(config.Datastore.Path)
if err != nil { if err != nil {
return return