mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
check empty
This commit is contained in:
@@ -88,12 +88,13 @@ class Backup extends Action
|
||||
}
|
||||
} while ($attempts < $max);
|
||||
|
||||
$this->xtrabackupContainerId = shell_exec('docker ps -aqf "name=xtrabackup"');
|
||||
$this->xtrabackupContainerId = str_replace(PHP_EOL, '', $this->xtrabackupContainerId);
|
||||
if (empty($this->xtrabackupContainerId)) {
|
||||
$containerId = shell_exec('docker ps -aqf "name=xtrabackup"');
|
||||
$containerId = str_replace(PHP_EOL, '', $containerId);
|
||||
if (empty($containerId)) {
|
||||
Console::error('Xtrabackup Container ID not found');
|
||||
Console::exit();
|
||||
}
|
||||
$this->xtrabackupContainerId = $containerId;
|
||||
|
||||
Console::loop(function () {
|
||||
$this->start();
|
||||
|
||||
@@ -21,19 +21,21 @@ class Restore extends Action
|
||||
protected ?DSN $dsn = null;
|
||||
protected string $database;
|
||||
protected ?DOSpaces $s3 = null;
|
||||
protected string|null $xtrabackupContainerId = null;
|
||||
protected string $xtrabackupContainerId;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->checkEnvVariables();
|
||||
|
||||
$this->xtrabackupContainerId = shell_exec('docker ps -aqf "name=xtrabackup"');
|
||||
$this->xtrabackupContainerId = str_replace(PHP_EOL, '', $this->xtrabackupContainerId);
|
||||
if (empty($this->xtrabackupContainerId)) {
|
||||
$containerId = shell_exec('docker ps -aqf "name=xtrabackup"');
|
||||
$containerId = str_replace(PHP_EOL, '', $containerId);
|
||||
if (empty($containerId)) {
|
||||
Console::error('Xtrabackup Container ID not found');
|
||||
Console::exit();
|
||||
}
|
||||
|
||||
$this->xtrabackupContainerId = $containerId;
|
||||
|
||||
$this
|
||||
->desc('Restore a DB')
|
||||
->param('id', '', new Text(20), 'The backup identification')
|
||||
|
||||
Reference in New Issue
Block a user