Skip to content

Commit a61b2f9

Browse files
authored
Merge pull request #12418 from quarto-dev/bugfix/12286
publish - timeout after 5 minutes
2 parents 1975167 + fc9b28a commit a61b2f9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/publish/gh-pages/gh-pages.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,23 @@ async function publish(
246246

247247
// wait for deployment if we are opening a browser
248248
let verified = false;
249+
const start = new Date();
250+
249251
if (options.browser && ghContext.siteUrl && !notifyGhPagesBranch) {
250252
await withSpinner({
251253
message:
252254
"Deploying gh-pages branch to website (this may take a few minutes)",
253255
}, async () => {
254256
const noJekyllUrl = joinUrl(ghContext.siteUrl!, ".nojekyll");
255257
while (true) {
258+
const now = new Date();
259+
const elapsed = now.getTime() - start.getTime();
260+
if (elapsed > 1000 * 60 * 5) {
261+
info(colors.yellow(
262+
"Deployment took longer than 5 minutes, giving up waiting for deployment to complete",
263+
));
264+
break;
265+
}
256266
await sleep(2000);
257267
const response = await fetch(noJekyllUrl);
258268
if (response.status === 200) {

0 commit comments

Comments
 (0)