mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
use memory when under 16 chunks
This commit is contained in:
parent
8e80f3cd65
commit
18ed06b420
|
@ -62,7 +62,7 @@ func (up *UploadPipeline) SaveDataAt(p []byte, off int64) (n int) {
|
||||||
|
|
||||||
memChunk, found := up.writableChunks[logicChunkIndex]
|
memChunk, found := up.writableChunks[logicChunkIndex]
|
||||||
if !found {
|
if !found {
|
||||||
if len(up.writableChunks) < 0 {
|
if len(up.writableChunks) < 16 {
|
||||||
memChunk = NewMemChunk(logicChunkIndex, up.ChunkSize)
|
memChunk = NewMemChunk(logicChunkIndex, up.ChunkSize)
|
||||||
} else {
|
} else {
|
||||||
memChunk = up.swapFile.NewTempFileChunk(logicChunkIndex)
|
memChunk = up.swapFile.NewTempFileChunk(logicChunkIndex)
|
||||||
|
|
Loading…
Reference in a new issue