mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 (#801)
* Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 * Add comment for golint to blank pprof import
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							c73b7a65f5
						
					
				
				
					commit
					17c5e12e6e
				
			@@ -9,6 +9,7 @@ import (
 | 
			
		||||
	"net"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/http/fcgi"
 | 
			
		||||
	_ "net/http/pprof" // Used for debugging if enabled and a web server is running
 | 
			
		||||
	"os"
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
@@ -645,6 +646,12 @@ func runWeb(ctx *cli.Context) error {
 | 
			
		||||
		log.Info("LFS server enabled")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if setting.EnablePprof {
 | 
			
		||||
		go func() {
 | 
			
		||||
			log.Info("%v", http.ListenAndServe("localhost:6060", nil))
 | 
			
		||||
		}()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var err error
 | 
			
		||||
	switch setting.Protocol {
 | 
			
		||||
	case setting.HTTP:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user