修复OpenFileCache可能无法更新的Bug

This commit is contained in:
GoEdgeLab
2022-03-31 11:47:31 +08:00
parent 3ee45c8380
commit 8985e7d79c
5 changed files with 35 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ func (this *OpenFilePool) Get() (*OpenFile, bool) {
}
func (this *OpenFilePool) Put(file *OpenFile) bool {
if file.version > 0 && file.version != this.version {
if this.version > 0 && file.version > 0 && file.version != this.version {
_ = file.Close()
return false
}