shithub: hugo

Download patch

ref: 14a1de14fb1ec93444ba5dd028fdad8959924545
parent: dcde8af8c6ab39eb34b5e1d6030d1aa2fe6923ca
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Wed Nov 27 04:51:47 EST 2019

modules: Add some more output if modules download takes time

Closes #6519

--- a/modules/collect.go
+++ b/modules/collect.go
@@ -21,6 +21,7 @@
 	"strings"
 	"time"
 
+	"github.com/bep/debounce"
 	"github.com/gohugoio/hugo/common/loggers"
 
 	"github.com/spf13/cast"
@@ -470,6 +471,12 @@
 
 func (c *collector) collect() {
 	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 {
 		c.err = err
 		return