diff options
author | Duncan Ogilvie <mr.exodia.tpodt@gmail.com> | 2017-11-29 02:50:39 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-11-29 09:50:39 +0800 |
commit | 551f3cbe420dcb72bcb784205451d5b01b811041 (patch) | |
tree | 612c505d8f46972a598e1ca118cba45c775f329d /vendor/code.gitea.io/git/commit.go | |
parent | 4035ab05fa2d2c8ec95d346fea91cab8211dab17 (diff) | |
download | gitea-551f3cbe420dcb72bcb784205451d5b01b811041.tar.gz gitea-551f3cbe420dcb72bcb784205451d5b01b811041.zip |
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>
Diffstat (limited to 'vendor/code.gitea.io/git/commit.go')
-rw-r--r-- | vendor/code.gitea.io/git/commit.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vendor/code.gitea.io/git/commit.go b/vendor/code.gitea.io/git/commit.go index c295412381..299a2381b6 100644 --- a/vendor/code.gitea.io/git/commit.go +++ b/vendor/code.gitea.io/git/commit.go @@ -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] |