diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-06-05 09:21:45 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-06-05 12:16:40 +0200 |
commit | 2b05a50f8f89e4e2f5f7a8ea7ae7993a2c0f3524 (patch) | |
tree | c1692563b326ff6928523955dd17d42d9973d980 /commands | |
parent | bc05d854b270dcabd9fb49ae031bb011d37cad2e (diff) | |
download | hugo-2b05a50f8f89e4e2f5f7a8ea7ae7993a2c0f3524.tar.gz hugo-2b05a50f8f89e4e2f5f7a8ea7ae7993a2c0f3524.zip |
Misc remote HTTP/content adapter enhancements
* Recover from server errors
* Improve go adapter rebuilds when adding new content
See #12502
Fixes #12570
Diffstat (limited to 'commands')
-rw-r--r-- | commands/hugobuilder.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/commands/hugobuilder.go b/commands/hugobuilder.go index 99bd8a04a..d77f1f178 100644 --- a/commands/hugobuilder.go +++ b/commands/hugobuilder.go @@ -345,6 +345,7 @@ func (c *hugoBuilder) newWatcher(pollIntervalStr string, dirList ...string) (*wa for { select { case changes := <-c.r.changesFromBuild: + c.errState.setBuildErr(nil) unlock, err := h.LockBuild() if err != nil { c.r.logger.Errorln("Failed to acquire a build lock: %s", err) @@ -356,7 +357,9 @@ func (c *hugoBuilder) newWatcher(pollIntervalStr string, dirList ...string) (*wa c.r.logger.Errorln("Error while watching:", err) } if c.s != nil && c.s.doLiveReload { - if c.changeDetector == nil || len(c.changeDetector.changed()) > 0 { + doReload := c.changeDetector == nil || len(c.changeDetector.changed()) > 0 + doReload = doReload || c.showErrorInBrowser && c.errCount() > 0 + if doReload { livereload.ForceRefresh() } } |