限制文件句柄缓存内存使用

This commit is contained in:
刘祥超
2023-10-11 21:51:05 +08:00
parent f01eae3590
commit 6ff3230bab
6 changed files with 123 additions and 60 deletions
+1 -1
View File
@@ -366,7 +366,7 @@ func (this *FileReader) Close() error {
} else {
var cacheMeta = make([]byte, len(this.meta))
copy(cacheMeta, this.meta)
this.openFileCache.Put(this.fp.Name(), NewOpenFile(this.fp, cacheMeta, this.header, this.LastModified()))
this.openFileCache.Put(this.fp.Name(), NewOpenFile(this.fp, cacheMeta, this.header, this.LastModified(), this.bodySize))
}
return nil
}