modules: Add some more output if modules download takes time

Closes #6519
This commit is contained in:
Bjørn Erik Pedersen 2019-11-27 09:51:47 +01:00
parent dcde8af8c6
commit 14a1de14fb
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -21,6 +21,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/bep/debounce"
"github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/common/loggers"
"github.com/spf13/cast" "github.com/spf13/cast"
@ -470,6 +471,12 @@ func (c *collector) applyThemeConfig(tc *moduleAdapter) error {
func (c *collector) collect() { func (c *collector) collect() {
defer c.logger.PrintTimerIfDelayed(time.Now(), "hugo: collected modules") defer c.logger.PrintTimerIfDelayed(time.Now(), "hugo: collected modules")
d := debounce.New(2 * time.Second)
d(func() {
c.logger.FEEDBACK.Println("hugo: downloading modules …")
})
defer d(func() {})
if err := c.initModules(); err != nil { if err := c.initModules(); err != nil {
c.err = err c.err = err
return return