mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-26 18:26:09 +01:00
🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887
This commit is contained in:
parent
cd3da736db
commit
e295c354d1
3 changed files with 7 additions and 4 deletions
|
|
@ -141,6 +141,8 @@ func NetImg2LocalAssets(rootID string) (err error) {
|
|||
name = util.FilterFileName(name)
|
||||
name = "net-img-" + name + "-" + ast.NewNodeID() + ext
|
||||
writePath := filepath.Join(util.DataDir, "assets", name)
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
if err = gulu.File.WriteFileSafer(writePath, data, 0644); nil != err {
|
||||
logging.LogErrorf("write downloaded net img [%s] to local assets [%s] failed: %s", u, writePath, err)
|
||||
return ast.WalkSkipChildren
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue