mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
🐛 修复 macOS 端构建报错
This commit is contained in:
parent
313181ef48
commit
c585ca972f
3 changed files with 6 additions and 9 deletions
|
@ -78,10 +78,7 @@ func NewCommand(cmdStr string, cmdId float64, param map[string]interface{}, sess
|
||||||
|
|
||||||
func Exec(cmd Cmd) {
|
func Exec(cmd Cmd) {
|
||||||
go func() {
|
go func() {
|
||||||
//start := time.Now()
|
|
||||||
defer logging.Recover()
|
defer logging.Recover()
|
||||||
cmd.Exec()
|
cmd.Exec()
|
||||||
//end := time.Now()
|
|
||||||
//util.Logger.Infof("cmd [%s] exec consumed [%d]ms", cmd.Name(), end.Sub(start).Milliseconds())
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/radovskyb/watcher"
|
"github.com/radovskyb/watcher"
|
||||||
|
"github.com/siyuan-note/logging"
|
||||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
|
@ -51,7 +52,7 @@ func watchAssets() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//util.LogInfof("assets changed: %s", event)
|
//logging.LogInfof("assets changed: %s", event)
|
||||||
if watcher.Write == event.Op {
|
if watcher.Write == event.Op {
|
||||||
IncSync()
|
IncSync()
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ func watchAssets() {
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
util.LogErrorf("watch assets failed: %s", err)
|
logging.LogErrorf("watch assets failed: %s", err)
|
||||||
case <-assetsWatcher.Closed:
|
case <-assetsWatcher.Closed:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -70,13 +71,13 @@ func watchAssets() {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err := assetsWatcher.Add(assetsDir); nil != err {
|
if err := assetsWatcher.Add(assetsDir); nil != err {
|
||||||
util.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//util.LogInfof("added file watcher [%s]", assetsDir)
|
//logging.LogInfof("added file watcher [%s]", assetsDir)
|
||||||
if err := assetsWatcher.Start(10 * time.Second); nil != err {
|
if err := assetsWatcher.Start(10 * time.Second); nil != err {
|
||||||
util.LogErrorf("start assets watcher for folder [%s] failed: %s", assetsDir, err)
|
logging.LogErrorf("start assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,6 @@ func BuildGraph(query string) (boxID string, nodes []*GraphNode, links []*GraphL
|
||||||
// 文档块关联
|
// 文档块关联
|
||||||
rootBlock := getBlockIn(treeBlocks, root.ID)
|
rootBlock := getBlockIn(treeBlocks, root.ID)
|
||||||
if nil == rootBlock {
|
if nil == rootBlock {
|
||||||
//util.LogWarnf("root block is nil [rootID=%s], tree blocks [len=%d], just skip it", root.ID, len(treeBlocks))
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue