From 7d95bbaebb3d89f01c8aaee3ea9a4d709a9bc2ad Mon Sep 17 00:00:00 2001 From: "Abdulmhsen B. A. A" Date: Wed, 13 Apr 2022 02:35:32 +0300 Subject: [PATCH] added new flag for import/export for request timeout option. --- src/Commands/State/ExportCommand.php | 10 ++++++++++ src/Commands/State/ImportCommand.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/Commands/State/ExportCommand.php b/src/Commands/State/ExportCommand.php index 3cdfec55..fadb6272 100644 --- a/src/Commands/State/ExportCommand.php +++ b/src/Commands/State/ExportCommand.php @@ -55,6 +55,12 @@ class ExportCommand extends Command InputOption::VALUE_REQUIRED, 'Disables the proxy for a comma-separated list of hosts that do not require it to get reached.' ) + ->addOption( + 'timeout', + null, + InputOption::VALUE_REQUIRED, + 'Set request timeout in seconds' + ) ->addOption( 'servers-filter', 's', @@ -180,6 +186,10 @@ class ExportCommand extends Command $opts['client']['no_proxy'] = $input->getOption('no-proxy'); } + if ($input->getOption('timeout')) { + $opts['client']['timeout'] = $input->getOption('timeout'); + } + $server['options'] = $opts; $server['class'] = makeServer($server, $name); diff --git a/src/Commands/State/ImportCommand.php b/src/Commands/State/ImportCommand.php index b89975a3..0d0629d7 100644 --- a/src/Commands/State/ImportCommand.php +++ b/src/Commands/State/ImportCommand.php @@ -60,6 +60,12 @@ class ImportCommand extends Command InputOption::VALUE_REQUIRED, 'Disables the proxy for a comma-separated list of hosts that do not require it to get reached.' ) + ->addOption( + 'timeout', + null, + InputOption::VALUE_REQUIRED, + 'Set request timeout in seconds' + ) ->addOption( 'servers-filter', 's', @@ -200,6 +206,10 @@ class ImportCommand extends Command $opts['client']['no_proxy'] = $input->getOption('no-proxy'); } + if ($input->getOption('timeout')) { + $opts['client']['timeout'] = $input->getOption('timeout'); + } + $server['options'] = $opts; $server['class'] = makeServer($server, $name);