Skip to content

Commit 6740082

Browse files
committed
Modify envWake command.
1 parent 21e8e4d commit 6740082

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Commands/Env/WakeCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public function wake($site_env, $options = [
5151
]);
5252
throw new TerminusException('Could not reach {target}', $wakeStatus);
5353
}
54+
if ($env->getSite()->isNodejs()) {
55+
// We do not expect a 'styx' header for Node.js sites so if we make it here, we assume success.
56+
$this->log()->notice('OK >> {target} responded', $wakeStatus);
57+
return;
58+
}
5459
if (empty($wakeStatus['styx'])) {
5560
throw new TerminusException('Pantheon headers missing, which is not quite right.');
5661
}

src/Models/Environment.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,12 +1040,18 @@ function ($domain) {
10401040
$success = false;
10411041
$lastError = null;
10421042

1043+
$wakeUrl = "https://{$domain->id}/pantheon_healthcheck";
1044+
if ($this->getSite()->isNodejs()) {
1045+
// For Node.js sites, we use the root path for the health check.
1046+
$wakeUrl = "https://{$domain->id}";
1047+
}
1048+
10431049
while ($attempt < $maxRetries && !$success) {
10441050
$lastError = null;
10451051
$attempt++;
10461052
try {
10471053
$response = $this->request()->request(
1048-
"https://{$domain->id}/pantheon_healthcheck"
1054+
$wakeUrl,
10491055
);
10501056
$success = ($response['status_code'] === 200);
10511057
if ($success) {

0 commit comments

Comments
 (0)