瀏覽代碼

prevents default create/open of buntdb, requires user to call initdb

tags/v1.0.0-rc1
Sean Enck 5 年之前
父節點
當前提交
c20afab7c2
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      irc/database.go

+ 4
- 0
irc/database.go 查看文件

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

Loading…
取消
儲存