aboutsummaryrefslogtreecommitdiffhomepage
path: root/deps
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-10-20 11:25:16 +0200
committerBjørn Erik Pedersen <[email protected]>2024-10-20 13:04:58 +0200
commit352be5ba8702017997587b3b99c42e66857b0627 (patch)
treecdb44bb7166606f3587627dfb989d0cd2fe8d83a /deps
parentd37606d2c2174e20cfba5150812da83378078f09 (diff)
downloadhugo-352be5ba8702017997587b3b99c42e66857b0627.tar.gz
hugo-352be5ba8702017997587b3b99c42e66857b0627.zip
Make sure that HugoSites is always closed when done
Including all the integration tests.
Diffstat (limited to 'deps')
-rw-r--r--deps/deps.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/deps.go b/deps/deps.go
index e137aed7b..4389036cb 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -98,6 +98,8 @@ type Deps struct {
// TODO(bep) rethink this re. a plugin setup, but this will have to do for now.
WasmDispatchers *warpc.Dispatchers
+ isClosed bool
+
*globalErrHandler
}
@@ -345,6 +347,11 @@ func (d *Deps) TextTmpl() tpl.TemplateParseFinder {
}
func (d *Deps) Close() error {
+ if d.isClosed {
+ return nil
+ }
+ d.isClosed = true
+
if d.MemCache != nil {
d.MemCache.Stop()
}