Przeglądaj źródła

Merge pull request #303 from enckse/master

prevents default create/open of buntdb, requires user to call initdb
tags/v1.0.0-rc1
Shivaram Lingamneni 5 lat temu
rodzic
commit
70364f5f67
No account linked to committer's email address
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4
    0
      irc/database.go

+ 4
- 0
irc/database.go Wyświetl plik

@@ -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

Ładowanie…
Anuluj
Zapisz