Skip to content

Commit a619c2b

Browse files
Add logging of wait counts to WaitForWakeTrait.php
1 parent 776436a commit a619c2b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Helpers/Traits/WaitForWakeTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ trait WaitForWakeTrait
2121
public function waitForWake(Environment $env, LoggerInterface $logger)
2222
{
2323
$waits = 0;
24+
$max_waits = $this->getConfig()->get('max_waits', 25);
25+
$logger->debug('max_waits: {max_waits}', ['max_waits' => $max_waits]);
2426
do {
27+
$logger->debug('wait #{waits}', ['waits' => $waits+1]);
2528
$woke = $env->wake();
2629
if (($woke['success'] ?? false) === true) {
2730
break;
2831
}
2932
// if success is empty, then the site is still waking up.
3033
// Allow user to set the number of retries if the site is still waking up.
3134
// Default should be 25 times, once per second.
32-
if ($waits > $this->getConfig()->get("wait_for_wake_repeat", 25)) {
35+
if ($waits > $max_waits) {
3336
$this->log()->error('{target} could not be reached, domain returned {status_code}.', [
3437
'status_code' => $woke['response']['status_code'],
3538
]);

0 commit comments

Comments
 (0)