优化缓存相关代码

This commit is contained in:
刘祥超
2023-10-02 19:48:11 +08:00
parent 2f6aa0c14f
commit 4405cfd405
3 changed files with 13 additions and 9 deletions

View File

@@ -560,7 +560,9 @@ func (this *FileStorage) openWriter(key string, expiredAt int64, status int, hea
if isNewCreated && existsFile {
flags |= os.O_TRUNC
}
fsutils.WriteBegin()
writer, err := os.OpenFile(tmpPath, flags, 0666)
fsutils.WriteEnd()
if err != nil {
// TODO 检查在各个系统中的稳定性
if os.IsNotExist(err) {