graph: make quadstore init functions idempotent
This commit is contained in:
parent
9658689995
commit
e849da9402
7 changed files with 63 additions and 24 deletions
|
|
@ -85,6 +85,11 @@ func createNewBolt(path string, _ graph.Options) error {
|
|||
defer db.Close()
|
||||
qs := &QuadStore{}
|
||||
qs.db = db
|
||||
defer qs.Close()
|
||||
err = qs.getMetadata()
|
||||
if err != errNoBucket {
|
||||
return graph.ErrDatabaseExists
|
||||
}
|
||||
err = qs.createBuckets()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue