Make sure that HugoSites is always closed when done

Including all the integration tests.
This commit is contained in:
Bjørn Erik Pedersen
2024-10-20 11:25:16 +02:00
parent d37606d2c2
commit 352be5ba87
4 changed files with 32 additions and 4 deletions

7
deps/deps.go vendored
View File

@@ -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()
}