Skip to content

Commit

Permalink
Solve issues from ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Dec 19, 2024
1 parent ca2e444 commit c73afb3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,10 @@ jobs:
URL="http://localhost:8000"
MAX_RETRIES=20
RETRY_INTERVAL=5
# Function to check if the service is up (returns HTTP 200)
check_service() {
# wget tries to fetch the URL quietly and returns only the status code
HTTP_CODE=$(wget --spider --server-response -q "$URL" 2>&1 | grep "HTTP/" | awk '{print $2}')
echo "$HTTP_CODE"
}
# Retry logic
RETRIES=0
while true; do
HTTP_CODE=$(check_service)
HTTP_CODE=$(wget --server-response -q "$URL" 2>&1 | grep "HTTP/" | awk '{print $2}')
if [ "$HTTP_CODE" -eq 200 ]; then
echo "Service is ready (HTTP 200)."
Expand All @@ -46,7 +37,6 @@ jobs:
exit 1
fi
echo "Service not ready (HTTP $HTTP_CODE). Retrying in $RETRY_INTERVAL seconds..."
RETRIES=$((RETRIES + 1))
sleep "$RETRY_INTERVAL"
sleep 5
done
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">

<!-- This code has been taken from: https://github.com/shuveb/io_uring-by-example/blob/master/public/index.html -->

<head>
<title>Welcome to ZeroHTTPd</title>
<style>
body {
font-family: sans-serif;
margin: 15px;
text-align: center;
}
</style>
</head>

<body>
<h1>It works! (kinda)</h1>
<img src="tux.png" alt="Tux, the Linux mascot">
<p>It is sure great to get out of that socket!</p>
<p>ZeroHTTPd is a ridiculously simple (and incomplete) web server written for learning about Linux performance.</p>
<p>Learn more about Linux performance at <a href="https://unixism.net">unixism.net</a></p>
</body>

</html>

0 comments on commit c73afb3

Please sign in to comment.