Skip to content

Keep backend warm

Keep backend warm #131

Workflow file for this run

name: Keep backend warm
# Render free-tier web services spin down after ~15 min idle, adding a ~50s cold
# start to the next request. Ping the health endpoint on a schedule to keep it
# awake. Free for this repo since it's public (unlimited Actions minutes).
#
# Best-effort: GitHub can delay scheduled runs under load, so an occasional cold
# start may still slip through, and GitHub disables schedules after 60 days of
# repo inactivity. For guaranteed pings use an external uptime monitor
# (UptimeRobot, cron-job.org) or a paid Render plan.
on:
schedule:
- cron: "*/10 * * * *" # every 10 minutes (under Render's ~15-min sleep)
workflow_dispatch: {} # allow manual runs
concurrency:
group: keep-warm
cancel-in-progress: true
jobs:
ping:
runs-on: ubuntu-24.04
steps:
- name: Ping the backend health endpoint
run: |
# The request wakes the instance regardless of status code, so don't
# fail the job on non-200 (avoids red runs during deploys/brief outages).
code=$(curl -sS -o /dev/null -w "%{http_code}" --max-time 90 https://metahelper.onrender.com/ || echo "000")
echo "Health check returned HTTP $code"