实现缓存策略最大容量

This commit is contained in:
刘祥超
2020-10-05 20:23:18 +08:00
parent 78a2480836
commit 6d2f18387f
6 changed files with 70 additions and 7 deletions

View File

@@ -114,6 +114,7 @@ func (this *HTTPWriter) Write(data []byte) (n int, err error) {
_, err = this.cacheWriter.Write(data)
if err != nil {
_ = this.cacheWriter.Discard()
this.cacheWriter = nil
logs.Println("write cache failed: " + err.Error())
}
}