Skip to content

Commit

Permalink
Merge branch 'main' into refactor/sid
Browse files Browse the repository at this point in the history
  • Loading branch information
bplatz committed Feb 21, 2025
2 parents 5cd285f + 0610cf6 commit b80ba57
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
13 changes: 13 additions & 0 deletions src/clj/fluree/db/connection/config.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,25 @@
:cljs (js/parseInt x))
(int x)))

(defn get-long
[x]
(if (string? x)
#?(:clj (Long/parseLong x)
:cljs (js/parseInt x))
(long x)))

(defn get-first-integer
[node k]
(some-> node
(get-first-value k)
get-integer))

(defn get-first-long
[node k]
(some-> node
(get-first-value k)
get-long))

(defn get-first-string
[node k]
(some-> node
Expand Down
22 changes: 11 additions & 11 deletions src/clj/fluree/db/connection/system.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
(defmethod ig/expand-key :fluree.db/connection
[k config]
(let [cache-max-mb (config/get-first-integer config conn-vocab/cache-max-mb)
commit-storage (get-first config conn-vocab/commit-storage)
index-storage (get-first config conn-vocab/index-storage)
commit-storage (get config conn-vocab/commit-storage)
index-storage (get config conn-vocab/index-storage)
remote-systems (get config conn-vocab/remote-systems)
config* (-> config
(assoc :cache (ig/ref :fluree.db/cache)
Expand All @@ -91,13 +91,13 @@
(dissoc conn-vocab/cache-max-mb conn-vocab/commit-storage
conn-vocab/index-storage))]
{:fluree.db/cache cache-max-mb
:fluree.db/commit-catalog {:content-stores [commit-storage]
:read-only-archives remote-systems}
:fluree.db/index-catalog {:content-stores [index-storage]
:read-only-archives remote-systems
:cache (ig/ref :fluree.db/cache)
:serializer (ig/ref :fluree.db/serializer)}
k config*}))
:fluree.db/commit-catalog {:content-stores commit-storage
:read-only-archives remote-systems}
:fluree.db/index-catalog {:content-stores index-storage
:read-only-archives remote-systems
:cache (ig/ref :fluree.db/cache)
:serializer (ig/ref :fluree.db/serializer)}
k config*}))

(defmethod ig/init-key :default
[_ component]
Expand Down Expand Up @@ -218,8 +218,8 @@
(defn parse-index-options
[defaults]
(when-let [index-options (get-first defaults conn-vocab/index-options)]
{:reindex-min-bytes (config/get-first-integer index-options conn-vocab/reindex-min-bytes)
:reindex-max-bytes (config/get-first-integer index-options conn-vocab/reindex-max-bytes)
{:reindex-min-bytes (config/get-first-long index-options conn-vocab/reindex-min-bytes)
:reindex-max-bytes (config/get-first-long index-options conn-vocab/reindex-max-bytes)
:max-old-indexes (config/get-first-integer index-options conn-vocab/max-old-indexes)}))

(defn parse-defaults
Expand Down

0 comments on commit b80ba57

Please sign in to comment.