mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
modules: Add some more output if modules download takes time
Closes #6519
This commit is contained in:
parent
dcde8af8c6
commit
14a1de14fb
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue