mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
Misc resource fixes/improvements
* Add --pprof flag to server to enable profile debugging. * Don't cache the resource content, it seem to eat memory on bigger sites. * Keep --printMemoryUsag running in server Fixes #11974
This commit is contained in:
parent
d0788b96ae
commit
2873324898
7 changed files with 58 additions and 65 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
@ -341,8 +342,12 @@ func (r *rootCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args
|
|||
if r.buildWatch {
|
||||
defer r.timeTrack(time.Now(), "Built")
|
||||
}
|
||||
err := b.build()
|
||||
return err
|
||||
close, err := b.build()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
close()
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -411,6 +416,7 @@ func (r *rootCommand) PreRun(cd, runner *simplecobra.Commandeer) error {
|
|||
MaxEntries: 1,
|
||||
OnEvict: func(key int32, value *hugolib.HugoSites) {
|
||||
value.Close()
|
||||
runtime.GC()
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue