mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Make db connect more robust (#5738)
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							f54e0d2f16
						
					
				
				
					commit
					1bb22b2b47
				
			@@ -169,12 +169,14 @@ var (
 | 
			
		||||
	DisableGitHooks       bool
 | 
			
		||||
 | 
			
		||||
	// Database settings
 | 
			
		||||
	UseSQLite3    bool
 | 
			
		||||
	UseMySQL      bool
 | 
			
		||||
	UseMSSQL      bool
 | 
			
		||||
	UsePostgreSQL bool
 | 
			
		||||
	UseTiDB       bool
 | 
			
		||||
	LogSQL        bool
 | 
			
		||||
	UseSQLite3       bool
 | 
			
		||||
	UseMySQL         bool
 | 
			
		||||
	UseMSSQL         bool
 | 
			
		||||
	UsePostgreSQL    bool
 | 
			
		||||
	UseTiDB          bool
 | 
			
		||||
	LogSQL           bool
 | 
			
		||||
	DBConnectRetries int
 | 
			
		||||
	DBConnectBackoff time.Duration
 | 
			
		||||
 | 
			
		||||
	// Indexer settings
 | 
			
		||||
	Indexer struct {
 | 
			
		||||
@@ -986,6 +988,8 @@ func NewContext() {
 | 
			
		||||
	}
 | 
			
		||||
	IterateBufferSize = Cfg.Section("database").Key("ITERATE_BUFFER_SIZE").MustInt(50)
 | 
			
		||||
	LogSQL = Cfg.Section("database").Key("LOG_SQL").MustBool(true)
 | 
			
		||||
	DBConnectRetries = Cfg.Section("database").Key("DB_RETRIES").MustInt(10)
 | 
			
		||||
	DBConnectBackoff = Cfg.Section("database").Key("DB_RETRY_BACKOFF").MustDuration(3 * time.Second)
 | 
			
		||||
 | 
			
		||||
	sec = Cfg.Section("attachment")
 | 
			
		||||
	AttachmentPath = sec.Key("PATH").MustString(path.Join(AppDataPath, "attachments"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user