Parcourir la source

fix: unit test, lint + script

Gabriel Horner il y a 1 an
Parent
commit
b1bcc1b2dd

+ 6 - 6
.clj-kondo/config.edn

@@ -128,9 +128,13 @@
              frontend.worker.handler.page.rename worker-page-rename
              frontend.worker.handler.file.util wfu
              lambdaisland.glogi log
-             logseq.common.path path
-             logseq.common.graph common-graph
              logseq.common.config common-config
+             logseq.common.graph common-graph
+             logseq.common.date-time-util date-time-util
+             logseq.common.path path
+             logseq.common.util common-util
+             logseq.common.util.page-ref page-ref
+             logseq.common.util.block-ref block-ref
              logseq.db ldb
              logseq.db.frontend.property db-property
              logseq.db.frontend.property.type db-property-type
@@ -143,12 +147,8 @@
              logseq.graph-parser.text text
              logseq.graph-parser.block gp-block
              logseq.graph-parser.mldoc gp-mldoc
-             logseq.common.util common-util
              logseq.graph-parser.property gp-property
-             logseq.common.util.page-ref page-ref
-             logseq.common.util.block-ref block-ref
              logseq.graph-parser.util.db db-util
-             logseq.graph-parser.date-time-util date-time-util
              logseq.outliner.core outliner-core
              logseq.outliner.pipeline outliner-pipeline
              logseq.outliner.datascript-report ds-report

+ 2 - 3
deps/db/test/logseq/db/sqlite/db_test.cljs → deps/db/test/logseq/db/sqlite/common_db_test.cljs

@@ -1,4 +1,4 @@
-(ns logseq.db.sqlite.db-test
+(ns logseq.db.sqlite.common-db-test
   (:require [cljs.test :refer [deftest async use-fixtures is testing]]
             ["fs" :as fs]
             ["path" :as node-path]
@@ -27,8 +27,7 @@
     (create-graph-dir "tmp/graphs" "test-db")
 
     (let [conn* (sqlite-db/open-db! "tmp/graphs" "test-db")
-          blocks [{:block/uuid (random-uuid)
-                   :file/path "logseq/config.edn"
+          blocks [{:file/path "logseq/config.edn"
                    :file/content "{:foo :bar}"}]
           _ (d/transact! conn* blocks)
           ;; Simulate getting data from sqlite and restoring it for frontend

+ 2 - 2
scripts/src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs

@@ -68,8 +68,8 @@
         blocks-tx (create-graph/create-blocks-tx (create-init-data options))]
     (println "Built" (count blocks-tx) "tx," (count (filter :block/name blocks-tx)) "pages and"
              (count (filter :block/content blocks-tx)) "blocks ...")
-    ;; Vary the chunking with page size for now
-    (let [tx-chunks (partition-all (:pages options) blocks-tx)]
+    ;; Vary the chunking with page size up to a max to avoid OOM
+    (let [tx-chunks (partition-all (min (:pages options) 30000) blocks-tx)]
       (loop [chunks tx-chunks
              chunk-num 1]
         (when-let [chunk (first chunks)]