+ [task#116512] Backup the system before the upgrade.

This commit is contained in:
dingguodong
2024-06-12 10:21:26 +08:00
committed by caoyanyi
parent 042a24cd24
commit eb0b26c367
+15
View File
@@ -320,6 +320,21 @@ class system extends control
$this->loadModel('action')->create('system', 0, 'upgradeSystem');
if($backup == 'yes')
{
$instance = $this->config->instance->zentaopaas;
$backupResult = $this->cne->backup($instance, 'SYSTEM', 'upgrade');
if($backupResult->code != 200) $this->sendError($backupResult->message);
while(true)
{
$backupStatus = $this->cne->getBackupStatus($instance, $backupResult->data->name);
if($backupStatus->code != 200) $this->sendError($backupStatus->message);
if(strtolower($backupStatus->data->status) == 'completed') break;
sleep(1);
}
}
$rawResult = $this->cne->upgrade($edition);
if($rawResult)
{