Memory usage improvements (#3013) (#3028)

* govendor update code.gitea.io/git

Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>

* Greatly improve memory usage

Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
This commit is contained in:
Lauris BH
2017-11-29 16:29:37 +02:00
committed by GitHub
parent 992ee21a29
commit 8cdd5a33cd
9 changed files with 86 additions and 22 deletions

3
vendor/code.gitea.io/git/commit.go generated vendored
View File

@@ -98,10 +98,11 @@ func (c *Commit) IsImageFile(name string) bool {
return false
}
dataRc, err := blob.Data()
dataRc, err := blob.DataAsync()
if err != nil {
return false
}
defer dataRc.Close()
buf := make([]byte, 1024)
n, _ := dataRc.Read(buf)
buf = buf[:n]