mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve file read/write locking https://github.com/siyuan-note/siyuan/issues/9748
This commit is contained in:
parent
4347d12af0
commit
b1cea465ac
8 changed files with 31 additions and 35 deletions
|
|
@ -554,8 +554,8 @@ func copyTempAsset(absPath string) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
filelock.RWLock.Lock()
|
||||
defer filelock.RWLock.Unlock()
|
||||
filelock.Lock(absPath)
|
||||
defer filelock.Unlock(absPath)
|
||||
|
||||
ext := filepath.Ext(absPath)
|
||||
ret = filepath.Join(dir, gulu.Rand.String(7)+ext)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue