From 4168e8c6ed41fa4cb53dfded67caed79a82e8789 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 13 Sep 2021 10:52:26 +0200 Subject: add read write wrappers to compress chunks' content --- chunk.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'chunk.go') diff --git a/chunk.go b/chunk.go index a1cf3cd..14b8cfd 100644 --- a/chunk.go +++ b/chunk.go @@ -4,8 +4,6 @@ import ( "bytes" "fmt" "io" - "log" - "os" "path" ) @@ -87,12 +85,7 @@ func (c *StoredChunk) Reader() io.ReadSeeker { } func (c *StoredChunk) Len() int { - path := c.Id.Path(c.repo.path) - info, err := os.Stat(path) - if err != nil { - log.Println("Chunk: could not stat file:", path) - } - return int(info.Size()) + return c.repo.chunkSize } func NewTempChunk(value []byte) *TempChunk { -- cgit v1.2.3