Flush partialCached cache on rebuilds

Fixes #4931
This commit is contained in:
Bjørn Erik Pedersen
2018-07-11 19:23:22 +02:00
parent d96f2a460f
commit 6b6dcb44a0
4 changed files with 51 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ import (
// Build builds all sites. If filesystem events are provided,
// this is considered to be a potential partial rebuild.
func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
if h.Metrics != nil {
h.Metrics.Reset()
}
@@ -42,6 +43,10 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
conf.whatChanged = &whatChanged{source: true, other: true}
}
for _, s := range h.Sites {
s.Deps.BuildStartListeners.Notify()
}
if len(events) > 0 {
// Rebuild
if err := h.initRebuild(conf); err != nil {