Skip to content

Commit

Permalink
commands: Avoid too many watch file handles causing the server to fai…
Browse files Browse the repository at this point in the history
…l to start

Fixes gohugoio#8904
  • Loading branch information
wzshiming authored Aug 19, 2021
1 parent 24589c0 commit 3f38c78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 {
Expand Down

0 comments on commit 3f38c78

Please sign in to comment.