From: Shiming Zhang Date: Thu, 19 Aug 2021 09:04:09 +0000 (+0800) Subject: commands: Avoid too many watch file handles causing the server to fail to start X-Git-Tag: v0.88.0~23 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3f38c785b7208440e2a9dd9a80cb39d4ae23e676;p=brevno-suite%2Fhugo commands: Avoid too many watch file handles causing the server to fail to start Fixes #8904 --- diff --git a/commands/server.go b/commands/server.go index 09cf43b2..48e76da6 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 {