Memory usage improvements (#3013)
* 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:
parent
4035ab05fa
commit
551f3cbe42
9 changed files with 86 additions and 22 deletions
3
vendor/code.gitea.io/git/commit.go
generated
vendored
3
vendor/code.gitea.io/git/commit.go
generated
vendored
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue