mirror of
				https://github.com/1Panel-dev/1Panel.git
				synced 2025-10-31 11:15:58 +08:00 
			
		
		
		
	fix: 快照恢复前先清空对应文件夹 (#1892)
This commit is contained in:
		
							parent
							
								
									1c0d0d46a7
								
							
						
					
					
						commit
						a51d2d15de
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -784,14 +784,17 @@ func (u *SnapshotService) handlePanelDatas(snapID uint, fileOp files.FileOp, ope | |||
| 		} | ||||
| 		_ = snapshotRepo.Update(snapID, map[string]interface{}{"recover_status": constant.StatusWaiting}) | ||||
| 
 | ||||
| 		_ = fileOp.Fs.RemoveAll(path.Join(target, "apps")) | ||||
| 		if err := u.handleUnTar(source+"/1panel/1panel_data.tar.gz", target); err != nil { | ||||
| 			return fmt.Errorf("recover panel data failed, err: %v", err) | ||||
| 		} | ||||
| 	case "re-recover": | ||||
| 		_ = fileOp.Fs.RemoveAll(path.Join(target, "apps")) | ||||
| 		if err := u.handleUnTar(source+"/1panel/1panel_data.tar.gz", target); err != nil { | ||||
| 			return fmt.Errorf("retry recover panel data failed, err: %v", err) | ||||
| 		} | ||||
| 	case "rollback": | ||||
| 		_ = fileOp.Fs.RemoveAll(path.Join(target, "apps")) | ||||
| 		if err := u.handleUnTar(source+"/1panel_data.tar.gz", target); err != nil { | ||||
| 			return fmt.Errorf("rollback panel data failed, err: %v", err) | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue