[cache]优化缓存文件写入加锁方法

This commit is contained in:
刘祥超
2021-01-11 23:06:50 +08:00
parent f93dba9d30
commit 6a42482323
4 changed files with 133 additions and 14 deletions

View File

@@ -366,7 +366,9 @@ func (this *HTTPWriter) prepareCache(size int64) {
expiredAt := utils.UnixTime() + life
cacheWriter, err := storage.Open(this.req.cacheKey, expiredAt)
if err != nil {
remotelogs.Error("REQUEST_WRITER", "write cache failed: "+err.Error())
if err != caches.ErrFileIsWriting {
remotelogs.Error("REQUEST_WRITER", "write cache failed: "+err.Error())
}
return
}
this.cacheWriter = cacheWriter