Skip to content

Commit b861820

Browse files
committed
ignore exceptions on post-updte frontend check
1 parent 720c2a0 commit b861820

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/Jobs/UpdateSite.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function handle(): void
7575
$this->preUpdateCode = $this->site->getFrontendStatus();
7676
} catch (RequestException $e) {
7777
// Catch request exceptions - they should not stop the process
78+
$this->preUpdateCode = $e->getResponse()->getStatusCode();
7879
}
7980

8081
// Let site fetch available updates
@@ -117,7 +118,14 @@ public function handle(): void
117118
}
118119

119120
// Compare codes
120-
if ($this->site->getFrontendStatus() !== $this->preUpdateCode) {
121+
try {
122+
$afterUpdateCode = $this->site->getFrontendStatus();
123+
} catch (RequestException $e) {
124+
// Again, do not fetch exceptions
125+
$afterUpdateCode = $e->getResponse()->getStatusCode();
126+
}
127+
128+
if ($afterUpdateCode !== $this->preUpdateCode) {
121129
throw new UpdateException(
122130
"afterUpdate",
123131
"Status code has changed after update for site: " . $this->site->id

0 commit comments

Comments
 (0)