graph/db: init KVStore outside of ChannelGraph

So that we can pass in the abstract V1Store in preparation for adding a
SQL implementation of the KVStore.
This commit is contained in:
Elle Mouton
2025-03-30 11:42:22 +02:00
parent 449684de87
commit 526fb7f181
8 changed files with 36 additions and 39 deletions

View File

@@ -1046,10 +1046,14 @@ func (d *DefaultDatabaseBuilder) BuildDatabase(
)
}
dbs.GraphDB, err = graphdb.NewChannelGraph(&graphdb.Config{
KVDB: databaseBackends.GraphDB,
KVStoreOpts: graphDBOptions,
}, chanGraphOpts...)
graphStore, err := graphdb.NewKVStore(
databaseBackends.GraphDB, graphDBOptions...,
)
if err != nil {
return nil, nil, err
}
dbs.GraphDB, err = graphdb.NewChannelGraph(graphStore, chanGraphOpts...)
if err != nil {
cleanUp()