1
0
Эх сурвалжийг харах

fix: assets shoudn't create :file/path entities

file and db graphs don't create :file/path entities for asset files.
Import shouldn't be doing this. Part of LOG-2990
Gabriel Horner 2 жил өмнө
parent
commit
e64810087c

+ 1 - 1
src/main/frontend/components/imports.cljs

@@ -199,7 +199,7 @@
                                               parent-dir (path/path-join repo-dir (path/dirname (.-rpath file)))]
                                               parent-dir (path/path-join repo-dir (path/dirname (.-rpath file)))]
                                           (p/do!
                                           (p/do!
                                            (fs/mkdir-if-not-exists parent-dir)
                                            (fs/mkdir-if-not-exists parent-dir)
-                                           (fs/write-file! repo repo-dir (.-rpath file) content nil))))))))
+                                           (fs/write-file! repo repo-dir (.-rpath file) content {:skip-transact? true}))))))))
           (recur))
           (recur))
         true))))
         true))))
 
 

+ 3 - 3
src/main/frontend/fs/node.cljs

@@ -19,7 +19,7 @@
     (p/resolved (= (string/trim disk-content) (string/trim db-content)))))
     (p/resolved (= (string/trim disk-content) (string/trim db-content)))))
 
 
 (defn- write-file-impl!
 (defn- write-file-impl!
-  [repo dir rpath content {:keys [ok-handler error-handler old-content skip-compare?]} stat]
+  [repo dir rpath content {:keys [ok-handler error-handler old-content skip-compare? skip-transact?]} stat]
   (let [file-fpath (path/path-join dir rpath)]
   (let [file-fpath (path/path-join dir rpath)]
     (if skip-compare?
     (if skip-compare?
       (p/catch
       (p/catch
@@ -55,8 +55,8 @@
                    mtime (gobj/get result "mtime")]
                    mtime (gobj/get result "mtime")]
              (when-not contents-matched?
              (when-not contents-matched?
                (ipc/ipc "backupDbFile" (config/get-local-dir repo) rpath disk-content content))
                (ipc/ipc "backupDbFile" (config/get-local-dir repo) rpath disk-content content))
-             (db/set-file-last-modified-at! repo rpath mtime)
-             (db/set-file-content! repo rpath content)
+             (when-not skip-transact? (db/set-file-last-modified-at! repo rpath mtime))
+             (when-not skip-transact? (db/set-file-content! repo rpath content))
              (when ok-handler
              (when ok-handler
                (ok-handler repo rpath result))
                (ok-handler repo rpath result))
              result)
              result)