Deploys filesystem datastore for metadata.
This commit is contained in:
parent
9365aa4d51
commit
336c4589b9
|
@ -67,6 +67,9 @@ when isMainModule:
|
|||
# permissions are insecure.
|
||||
quit QuitFailure
|
||||
|
||||
if not(checkAndCreateDataDir((config.metaDir).string)):
|
||||
quit QuitFailure
|
||||
|
||||
trace "Data dir initialized", dir = $config.dataDir
|
||||
|
||||
if not(checkAndCreateDataDir((config.dataDir / "repo"))):
|
||||
|
|
|
@ -252,10 +252,12 @@ proc new*(
|
|||
of repoSQLite: Datastore(SQLiteDatastore.new($config.dataDir)
|
||||
.expect("Should create repo SQLite data store!"))
|
||||
|
||||
metadataStore = Datastore(FSDatastore.new($config.metaDir, depth = 5)
|
||||
.expect("Should create repo metadata store!"))
|
||||
|
||||
repoStore = RepoStore.new(
|
||||
repoDs = repoData,
|
||||
metaDs = SQLiteDatastore.new(config.dataDir / CodexMetaNamespace)
|
||||
.expect("Should create meta data store!"),
|
||||
metaDs = metadataStore,
|
||||
quotaMaxBytes = config.storageQuota.uint,
|
||||
blockTtl = config.blockTtl)
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ const
|
|||
codex_enable_log_counter* {.booldefine.} = false
|
||||
|
||||
DefaultDataDir* = defaultDataDir()
|
||||
DefaultMetaDataDir* = defaultDataDir() / "metadata"
|
||||
|
||||
type
|
||||
StartUpCmd* {.pure.} = enum
|
||||
|
@ -125,6 +126,13 @@ type
|
|||
abbr: "d"
|
||||
name: "data-dir" }: OutDir
|
||||
|
||||
metaDir* {.
|
||||
desc: "The directory where codex will store metadata"
|
||||
defaultValue: DefaultMetaDataDir
|
||||
defaultValueDesc: $DefaultMetaDataDir
|
||||
abbr: "md"
|
||||
name: "meta-dir" }: OutDir
|
||||
|
||||
listenAddrs* {.
|
||||
desc: "Multi Addresses to listen on"
|
||||
defaultValue: @[
|
||||
|
|
Loading…
Reference in New Issue