diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-10-19 10:53:27 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-10-20 09:46:45 +0200 |
commit | 5160c7efa5771d74b560f9c2ea761f09e08a9216 (patch) | |
tree | 02eecf016485128c5c7a2d2c38628688fd20d936 /deps | |
parent | e2dd4cd05fa96a08d49b3b198edf0ccf9a94970e (diff) | |
download | hugo-5160c7efa5771d74b560f9c2ea761f09e08a9216.tar.gz hugo-5160c7efa5771d74b560f9c2ea761f09e08a9216.zip |
tpl/debug: Add debug.Timer
Closes #11580
Diffstat (limited to 'deps')
-rw-r--r-- | deps/deps.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/deps/deps.go b/deps/deps.go index 309555080..4d1812015 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -33,7 +33,6 @@ import ( // There will be normally only one instance of deps in play // at a given time, i.e. one per Site built. type Deps struct { - // The logger to use. Log loggers.Logger `json:"-"` @@ -77,6 +76,9 @@ type Deps struct { // BuildStartListeners will be notified before a build starts. BuildStartListeners *Listeners + // BuildEndListeners will be notified after a build finishes. + BuildEndListeners *Listeners + // Resources that gets closed when the build is done or the server shuts down. BuildClosers *Closers @@ -97,7 +99,6 @@ func (d Deps) Clone(s page.Site, conf config.AllProvider) (*Deps, error) { } return &d, nil - } func (d *Deps) SetTempl(t *tpl.TemplateHandlers) { @@ -132,6 +133,10 @@ func (d *Deps) Init() error { d.BuildStartListeners = &Listeners{} } + if d.BuildEndListeners == nil { + d.BuildEndListeners = &Listeners{} + } + if d.BuildClosers == nil { d.BuildClosers = &Closers{} } |