mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Fix #1262 : Add timeout on backup db process
This commit is contained in:
@@ -35,6 +35,7 @@ class module_console_systemBackupDB extends Command
|
|||||||
$this
|
$this
|
||||||
->setDescription('Backup Phraseanet Databases')
|
->setDescription('Backup Phraseanet Databases')
|
||||||
->addArgument('directory', null, 'The directory where to backup', $dir)
|
->addArgument('directory', null, 'The directory where to backup', $dir)
|
||||||
|
->addOption('timeout', 't', null, 'The timeout for this command (default is 3600s / 1h). Set 0 to disable timeout.', 3600)
|
||||||
->addOption('gzip', 'g', null, 'Gzip the output (requires gzip utility)')
|
->addOption('gzip', 'g', null, 'Gzip the output (requires gzip utility)')
|
||||||
->addOption('bzip', 'b', null, 'Bzip the output (requires bzip2 utility)');
|
->addOption('bzip', 'b', null, 'Bzip the output (requires bzip2 utility)');
|
||||||
|
|
||||||
@@ -89,6 +90,7 @@ class module_console_systemBackupDB extends Command
|
|||||||
$command .= ' > ' . escapeshellarg($filename);
|
$command .= ' > ' . escapeshellarg($filename);
|
||||||
|
|
||||||
$process = new Process($command);
|
$process = new Process($command);
|
||||||
|
$process->setTimeout((int) $input->getOption('timeout'));
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|
||||||
if (!$process->isSuccessful()) {
|
if (!$process->isSuccessful()) {
|
||||||
|
Reference in New Issue
Block a user