Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to set execution timeout #1046

Merged
merged 2 commits into from Mar 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Commands/BackupCommand.php
Expand Up @@ -10,7 +10,7 @@
class BackupCommand extends BaseCommand
{
/** @var string */
protected $signature = 'backup:run {--filename=} {--only-db} {--db-name=*} {--only-files} {--only-to-disk=} {--disable-notifications}';
protected $signature = 'backup:run {--filename=} {--only-db} {--db-name=*} {--only-files} {--only-to-disk=} {--disable-notifications} {--timeout=}';

/** @var string */
protected $description = 'Run the backup.';
Expand All @@ -21,6 +21,10 @@ public function handle()

$disableNotifications = $this->option('disable-notifications');

if ($this->option('timeout') && is_numeric($this->option('timeout'))) {
set_time_limit((int) $this->option('timeout'));
}

try {
$this->guardAgainstInvalidOptions();

Expand Down