Skip to content

Commit

Permalink
chore: http spec logs
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelAndalon committed Mar 11, 2024
1 parent 4063758 commit 65941cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integration/graphql-http-spec/healthcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const targetUrl = 'http://localhost:8080/graphql';
async function healthCheck() {
let attempts = 100;
while (attempts--) {
console.log("waiting for server")
console.log("waiting for server");
try {
const health = await fetch(targetUrl, {
method: 'POST',
Expand All @@ -19,10 +19,12 @@ async function healthCheck() {
})
if (health.status === 200) {
return true;
} else {
console.log(`Error status: ${health.status}`);
}

} catch (e) {
// continue
console.log(`Error: ${e}`);
}

await new Promise((r) => setTimeout(r, 1000));
Expand Down

0 comments on commit 65941cd

Please sign in to comment.