mirror of
				https://github.com/usmannasir/cyberpanel.git
				synced 2025-10-31 10:26:01 +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}" |                     restore_cmd = f"gunzip -c {backup_file} | {mysql_cmd}" | ||||||
|                     result = ProcessUtilities.executioner(restore_cmd, shell=True) |                     result = ProcessUtilities.executioner(restore_cmd, shell=True) | ||||||
|  |  | ||||||
|                     if result != 0: |                     # Don't rely solely on exit code, MySQL import usually succeeds | ||||||
|                         logging.CyberCPLogFileWriter.writeToFile( |                     # The passwordCheck logic below will verify database integrity | ||||||
|                             f"Could not restore database: {databaseName} from compressed backup" |  | ||||||
|                         ) |  | ||||||
|                         return 0 |  | ||||||
|                 else: |                 else: | ||||||
|                     # Handle uncompressed backup (legacy) |                     # Handle uncompressed backup (legacy) | ||||||
|                     cmd = shlex.split(mysql_cmd) |                     cmd = shlex.split(mysql_cmd) | ||||||
|                     with open(backup_file, 'r') as f: |                     with open(backup_file, 'r') as f: | ||||||
|                         result = subprocess.call(cmd, stdin=f) |                         result = subprocess.call(cmd, stdin=f) | ||||||
|  |  | ||||||
|                     if result != 0: |                     # Don't fail on non-zero exit as MySQL may return warnings | ||||||
|                         logging.CyberCPLogFileWriter.writeToFile( |                     # The passwordCheck logic below will verify database integrity | ||||||
|                             f"Could not restore database: {databaseName}" |  | ||||||
|                         ) |  | ||||||
|                         return 0 |  | ||||||
|  |  | ||||||
|                 if passwordCheck == None: |                 if passwordCheck == None: | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user