mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-10-29 19:32:51 +00:00 
			
		
		
		
	fix: issue 2953. Restore from .db file fails because
This commit is contained in:
		
							parent
							
								
									1ddfe4aba3
								
							
						
					
					
						commit
						9c7cd8b54f
					
				
					 1 changed files with 0 additions and 11 deletions
				
			
		|  | @ -524,9 +524,6 @@ func (s *ServerService) ImportDB(file multipart.File) error { | ||||||
| 	} | 	} | ||||||
| 	defer tempFile.Close() | 	defer tempFile.Close() | ||||||
| 
 | 
 | ||||||
| 	// Remove temp file before returning
 |  | ||||||
| 	defer os.Remove(tempPath) |  | ||||||
| 
 |  | ||||||
| 	// Save uploaded file to temporary file
 | 	// Save uploaded file to temporary file
 | ||||||
| 	_, err = io.Copy(tempFile, file) | 	_, err = io.Copy(tempFile, file) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | @ -572,14 +569,6 @@ func (s *ServerService) ImportDB(file multipart.File) error { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Migrate DB
 | 	// Migrate DB
 | ||||||
| 	err = database.InitDB(config.GetDBPath()) |  | ||||||
| 	if err != nil { |  | ||||||
| 		errRename := os.Rename(fallbackPath, config.GetDBPath()) |  | ||||||
| 		if errRename != nil { |  | ||||||
| 			return common.NewErrorf("Error migrating db and restoring fallback: %v", errRename) |  | ||||||
| 		} |  | ||||||
| 		return common.NewErrorf("Error migrating db: %v", err) |  | ||||||
| 	} |  | ||||||
| 	s.inboundService.MigrateDB() | 	s.inboundService.MigrateDB() | ||||||
| 
 | 
 | ||||||
| 	// Start Xray
 | 	// Start Xray
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Columbiysky
						Columbiysky