mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	commands: Avoid too many watch file handles causing the server to fail to start
Fixes #8904
This commit is contained in:
		@@ -261,6 +261,11 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error {
 | 
				
			|||||||
		s.RegisterMediaTypes()
 | 
							s.RegisterMediaTypes()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err = c.serve(sc)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Watch runs its own server as part of the routine
 | 
						// Watch runs its own server as part of the routine
 | 
				
			||||||
	if sc.serverWatch {
 | 
						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 {
 | 
					func getRootWatchDirsStr(baseDir string, watchDirs []string) string {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user