-
Notifications
You must be signed in to change notification settings - Fork 196
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
[LOPS-2314] Adds retry option to Drush and WP-CLI commands #2588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, a couple comments/questions here and there :)
src/Commands/Remote/WPCommand.php
Outdated
{ | ||
$this->prepareEnvironment($site_env); | ||
$this->setProgressAllowed($options['progress']); | ||
return $this->executeCommand($wp_command); | ||
$retries = isset($options['retry']) ? (int)$options['retry'] : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that ?:
is available in php 7.4. If so, this could just be (int)$options['retry'] ?: 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminus uses this operator elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want (int)$options['retry'] ?: 0;
or (int)($options['retry'] ?? 0);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first looks clearer to me, but both should behave the same. You may use the later if you prefer it.
Description:
Screen.Recording.2024-05-29.at.10.58.38.AM.mov
CCB Ticket