mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
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
|
@ -73,11 +73,16 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
|||
|
||||
// No way to edit a directory online.
|
||||
if entry.IsDir() {
|
||||
ctx.Handle(404, "", nil)
|
||||
ctx.Handle(404, "entry.IsDir", nil)
|
||||
return
|
||||
}
|
||||
|
||||
blob := entry.Blob()
|
||||
if blob.Size() >= setting.UI.MaxDisplayFileSize {
|
||||
ctx.Handle(404, "blob.Size", err)
|
||||
return
|
||||
}
|
||||
|
||||
dataRc, err := blob.Data()
|
||||
if err != nil {
|
||||
ctx.Handle(404, "blob.Data", err)
|
||||
|
@ -93,7 +98,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
|||
|
||||
// Only text file are editable online.
|
||||
if !base.IsTextFile(buf) {
|
||||
ctx.Handle(404, "", nil)
|
||||
ctx.Handle(404, "base.IsTextFile", nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue