Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShiming Zhang <wzshiming@foxmail.com>2021-08-19 12:04:09 +0300
committerGitHub <noreply@github.com>2021-08-19 12:04:09 +0300
commit3f38c785b7208440e2a9dd9a80cb39d4ae23e676 (patch)
treebbec7edbfcc39a772767d5258f941de56c85fc40 /commands/server.go
parent24589c0814bc5d21565470bec6215ee792f1655e (diff)
commands: Avoid too many watch file handles causing the server to fail to start
Fixes #8904
Diffstat (limited to 'commands/server.go')
-rw-r--r--commands/server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/commands/server.go b/commands/server.go
index 09cf43b24..48e76da6b 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -261,6 +261,11 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error {
s.RegisterMediaTypes()
}
+ err = c.serve(sc)
+ if err != nil {
+ return err
+ }
+
// Watch runs its own server as part of the routine
if sc.serverWatch {
@@ -283,7 +288,7 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error {
}
- return c.serve(sc)
+ return nil
}
func getRootWatchDirsStr(baseDir string, watchDirs []string) string {