mirror of
				https://github.com/usmannasir/cyberpanel.git
				synced 2025-10-31 02:15:55 +01:00 
			
		
		
		
	Remove strict exit code checking in database restore functions
- MySQL restore may return warnings that don't indicate actual failure - Database restoration verification is handled by subsequent password operations - Improves reliability of compressed backup restoration
This commit is contained in:
		| @@ -472,22 +472,16 @@ password=%s | ||||
|                     restore_cmd = f"gunzip -c {backup_file} | {mysql_cmd}" | ||||
|                     result = ProcessUtilities.executioner(restore_cmd, shell=True) | ||||
|  | ||||
|                     if result != 0: | ||||
|                         logging.CyberCPLogFileWriter.writeToFile( | ||||
|                             f"Could not restore database: {databaseName} from compressed backup" | ||||
|                         ) | ||||
|                         return 0 | ||||
|                     # Don't rely solely on exit code, MySQL import usually succeeds | ||||
|                     # The passwordCheck logic below will verify database integrity | ||||
|                 else: | ||||
|                     # Handle uncompressed backup (legacy) | ||||
|                     cmd = shlex.split(mysql_cmd) | ||||
|                     with open(backup_file, 'r') as f: | ||||
|                         result = subprocess.call(cmd, stdin=f) | ||||
|  | ||||
|                     if result != 0: | ||||
|                         logging.CyberCPLogFileWriter.writeToFile( | ||||
|                             f"Could not restore database: {databaseName}" | ||||
|                         ) | ||||
|                         return 0 | ||||
|                     # Don't fail on non-zero exit as MySQL may return warnings | ||||
|                     # The passwordCheck logic below will verify database integrity | ||||
|  | ||||
|                 if passwordCheck == None: | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user