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:
Bjørn Erik Pedersen
2024-02-02 16:00:48 +01:00
parent d0788b96ae
commit 2873324898
7 changed files with 58 additions and 65 deletions

View File

@@ -163,15 +163,15 @@ func (r *Spec) NewResource(rd ResourceSourceDescriptor) (resource.Resource, erro
}
gr := &genericResource{
Staler: &AtomicStaler{},
h: &resourceHash{},
paths: rp,
spec: r,
sd: rd,
params: make(map[string]any),
name: rd.Name,
title: rd.Name,
resourceContent: &resourceContent{},
Staler: &AtomicStaler{},
h: &resourceHash{},
publishInit: &sync.Once{},
paths: rp,
spec: r,
sd: rd,
params: make(map[string]any),
name: rd.Name,
title: rd.Name,
}
if rd.MediaType.MainType == "image" {