mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: graph keep re-index when loading
The reason is that `mtime` and `ctime` are lost in the main thread.
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
(utils/read-file path))
|
(utils/read-file path))
|
||||||
stat (when (and (not= event "unlink")
|
stat (when (and (not= event "unlink")
|
||||||
(not dir-path?))
|
(not dir-path?))
|
||||||
(fs/statSync path))]
|
(utils/fs-stat->clj path))]
|
||||||
(send-file-watcher! dir event (merge {:dir (utils/fix-win-path! dir)
|
(send-file-watcher! dir event (merge {:dir (utils/fix-win-path! dir)
|
||||||
:path (utils/fix-win-path! path)
|
:path (utils/fix-win-path! path)
|
||||||
:content content
|
:content content
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
(when (and (chmod-enabled?) (fs/existsSync path) (not (writable? path)))
|
(when (and (chmod-enabled?) (fs/existsSync path) (not (writable? path)))
|
||||||
(fs/chmodSync path "644"))
|
(fs/chmodSync path "644"))
|
||||||
(fs/writeFileSync path content)
|
(fs/writeFileSync path content)
|
||||||
(fs/statSync path)
|
(utils/fs-stat->clj path)
|
||||||
(catch :default e
|
(catch :default e
|
||||||
(logger/warn ::write-file path e)
|
(logger/warn ::write-file path e)
|
||||||
(let [backup-path (try
|
(let [backup-path (try
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
(fs/renameSync old-path new-path))
|
(fs/renameSync old-path new-path))
|
||||||
|
|
||||||
(defmethod handle :stat [_window [_ path]]
|
(defmethod handle :stat [_window [_ path]]
|
||||||
(fs/statSync path))
|
(utils/fs-stat->clj path))
|
||||||
|
|
||||||
(defn- get-files
|
(defn- get-files
|
||||||
"Returns vec of file-objs"
|
"Returns vec of file-objs"
|
||||||
@@ -506,7 +506,6 @@
|
|||||||
(debounced-configure-auto-commit!)
|
(debounced-configure-auto-commit!)
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
|
|
||||||
(defmethod handle :installMarketPlugin [_ [_ mft]]
|
(defmethod handle :installMarketPlugin [_ [_ mft]]
|
||||||
(plugin/install-or-update! mft))
|
(plugin/install-or-update! mft))
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,6 @@
|
|||||||
(logger/warn "Unknown PAC rule:" line)
|
(logger/warn "Unknown PAC rule:" line)
|
||||||
nil))))
|
nil))))
|
||||||
|
|
||||||
|
|
||||||
(defn <get-system-proxy
|
(defn <get-system-proxy
|
||||||
"Get system proxy for url, requires proxy to be set to system"
|
"Get system proxy for url, requires proxy to be set to system"
|
||||||
([] (<get-system-proxy "https://www.google.com"))
|
([] (<get-system-proxy "https://www.google.com"))
|
||||||
@@ -288,3 +287,10 @@
|
|||||||
(catch :default _
|
(catch :default _
|
||||||
(println "decodeURIComponent failed: " uri)
|
(println "decodeURIComponent failed: " uri)
|
||||||
uri)))
|
uri)))
|
||||||
|
|
||||||
|
(defn fs-stat->clj
|
||||||
|
[path]
|
||||||
|
(let [stat (fs/statSync path)]
|
||||||
|
{:size (.-size stat)
|
||||||
|
:mtime (.-mtime stat)
|
||||||
|
:ctime (.-ctime stat)}))
|
||||||
|
|||||||
Reference in New Issue
Block a user