写入和删除缓存文件时增加线程数限制

This commit is contained in:
GoEdgeLab
2024-04-29 22:36:26 +08:00
parent 43a594198e
commit f5136e94d8
15 changed files with 117 additions and 136 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/binary"
"errors"
"fmt"
fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs"
rangeutils "github.com/TeaOSLab/EdgeNode/internal/utils/ranges"
"github.com/iwind/TeaGo/types"
"io"
@@ -146,7 +147,7 @@ func (this *PartialFileReader) IsCompleted() bool {
func (this *PartialFileReader) discard() error {
SharedPartialRangesQueue.Delete(this.rangePath)
_ = os.Remove(this.rangePath)
_ = fsutils.Remove(this.rangePath)
return this.FileReader.discard()
}