🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887

This commit is contained in:
Liang Ding 2022-09-17 21:35:42 +08:00
parent cd3da736db
commit e295c354d1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 7 additions and 4 deletions

View file

@ -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