diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-02 16:00:48 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-02 18:46:23 +0100 |
commit | 28733248983c1afc1e4e15dfc30fcf4c442e6ca4 (patch) | |
tree | f8680096a715dd88c5ad3f8de7d8f6fdde54faa8 /hugolib | |
parent | d0788b96ae74eb2d48a75c7147e7c6a5457977da (diff) |
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
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/hugo_sites_build.go | 2 | ||||
-rw-r--r-- | hugolib/rebuild_test.go | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go index 257949334..a15e15504 100644 --- a/hugolib/hugo_sites_build.go +++ b/hugolib/hugo_sites_build.go @@ -720,9 +720,11 @@ func (h *HugoSites) processPartial(ctx context.Context, l logg.LevelLogger, conf h.pageTrees.treeTaxonomyEntries.DeletePrefix("") if delete { + _, ok := h.pageTrees.treePages.LongestPrefixAll(pathInfo.Base()) if ok { h.pageTrees.treePages.DeleteAll(pathInfo.Base()) + h.pageTrees.resourceTrees.DeleteAll(pathInfo.Base()) if pathInfo.IsBundle() { // Assume directory removed. h.pageTrees.treePages.DeletePrefixAll(pathInfo.Base() + "/") diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go index d3ac5665d..74b04fe01 100644 --- a/hugolib/rebuild_test.go +++ b/hugolib/rebuild_test.go @@ -101,10 +101,10 @@ func TestRebuildEditTextFileInBranchBundle(t *testing.T) { func TestRebuildRenameTextFileInLeafBundle(t *testing.T) { b := TestRunning(t, rebuildFilesSimple) - b.AssertFileContent("public/mysection/mysectionbundle/index.html", "My Section Bundle Text 2 Content.") + b.AssertFileContent("public/mysection/mysectionbundle/index.html", "My Section Bundle Text 2 Content.", "Len Resources: 2|") b.RenameFile("content/mysection/mysectionbundle/mysectionbundletext.txt", "content/mysection/mysectionbundle/mysectionbundletext2.txt").Build() - b.AssertFileContent("public/mysection/mysectionbundle/index.html", "mysectionbundletext2", "My Section Bundle Text 2 Content.") + b.AssertFileContent("public/mysection/mysectionbundle/index.html", "mysectionbundletext2", "My Section Bundle Text 2 Content.", "Len Resources: 2|") b.AssertRenderCountPage(3) b.AssertRenderCountContent(3) } |