mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-28 10:52:51 +00:00
Merge 9c7cd8b54f into 6d47496069
This commit is contained in:
commit
6be46df185
1 changed files with 0 additions and 11 deletions
|
|
@ -524,9 +524,6 @@ func (s *ServerService) ImportDB(file multipart.File) error {
|
|||
}
|
||||
defer tempFile.Close()
|
||||
|
||||
// Remove temp file before returning
|
||||
defer os.Remove(tempPath)
|
||||
|
||||
// Save uploaded file to temporary file
|
||||
_, err = io.Copy(tempFile, file)
|
||||
if err != nil {
|
||||
|
|
@ -572,14 +569,6 @@ func (s *ServerService) ImportDB(file multipart.File) error {
|
|||
}
|
||||
|
||||
// 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()
|
||||
|
||||
// Start Xray
|
||||
|
|
|
|||
Loading…
Reference in a new issue