This commit is contained in:
Daniel 2023-08-15 16:18:43 +08:00
parent 0c0c6834c6
commit a169b3913a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 10 additions and 2 deletions

View file

@ -444,9 +444,12 @@ func copyTempAsset(absPath string) (ret string) {
return
}
filelock.RWLock.Lock()
defer filelock.RWLock.Unlock()
ret = filepath.Join(dir, gulu.Rand.String(7)+".docx")
if err := filelock.Copy(absPath, ret); nil != err {
logging.LogErrorf("copy [%s] to [%s] failed: [%s]", absPath, ret, err)
if err := gulu.File.Copy(absPath, ret); nil != err {
logging.LogErrorf("copy [src=%s, dest=%s] failed: %s", absPath, ret, err)
return
}
return