mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-14 20:33:59 +02: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:
@@ -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()
|
||||
},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user