Skip to content

Commit 8eceb41

Browse files
authored
Retry logic was already in environment wake logic, need to pass variables (#2686)
1 parent b1db219 commit 8eceb41

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/Commands/Env/WakeCommand.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,10 @@ public function wake($site_env, $options = [
3838
'delay' => 3,
3939
])
4040
{
41-
$attempt = 1;
4241
$this->requireSiteIsNotFrozen($site_env);
4342
$env = $this->getEnv($site_env);
4443

45-
while ($attempt <= $options['retry']) {
46-
$wakeStatus = $env->wake();
47-
if (empty($wakeStatus['success'])) {
48-
$this->log()->notice('{target} is not awake (attempt {attempt}/{max})...', [
49-
'target' => $site_env,
50-
'attempt' => $attempt,
51-
'max' => $options['retry'],
52-
]);
53-
// If there is any attempt remaining, sleep for the delay period.
54-
if ($attempt <= $options['retry'] - 1) {
55-
$this->log()->notice('Sleeping for {delay} seconds...', ['delay' => $options['delay']]);
56-
sleep($options['delay']);
57-
}
58-
$attempt++;
59-
continue;
60-
}
61-
break;
62-
}
44+
$wakeStatus = $env->wake($options['retry'], $options['delay']);
6345

6446
// @TODO: Move the exceptions up the chain to the `wake` function. (One env is ported over).
6547
if (empty($wakeStatus['success'])) {

0 commit comments

Comments
 (0)