mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
f7bc4cc505
commit
a2a660ed12
2 changed files with 7 additions and 1 deletions
|
@ -61,6 +61,8 @@ type commandeer struct {
|
||||||
logger loggers.Logger
|
logger loggers.Logger
|
||||||
serverConfig *config.Server
|
serverConfig *config.Server
|
||||||
|
|
||||||
|
buildLock func() (unlock func(), err error)
|
||||||
|
|
||||||
// Loading state
|
// Loading state
|
||||||
mustHaveConfigFile bool
|
mustHaveConfigFile bool
|
||||||
failOnInitErr bool
|
failOnInitErr bool
|
||||||
|
@ -419,6 +421,10 @@ func (c *commandeer) loadConfig() error {
|
||||||
err = createErr
|
err = createErr
|
||||||
}
|
}
|
||||||
c.hugoSites = h
|
c.hugoSites = h
|
||||||
|
// TODO(bep) improve.
|
||||||
|
if c.buildLock == nil {
|
||||||
|
c.buildLock = h.LockBuild
|
||||||
|
}
|
||||||
close(c.created)
|
close(c.created)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -869,7 +869,7 @@ func (c *commandeer) newWatcher(pollIntervalStr string, dirList ...string) (*wat
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case evs := <-watcher.Events:
|
case evs := <-watcher.Events:
|
||||||
unlock, err := c.hugo().BaseFs.LockBuild()
|
unlock, err := c.buildLock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Errorln("Failed to acquire a build lock: %s", err)
|
c.logger.Errorln("Failed to acquire a build lock: %s", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue