Skip to content

Revalidate SWP Mensa Data Cron Job #10544

Revalidate SWP Mensa Data Cron Job

Revalidate SWP Mensa Data Cron Job #10544

Workflow file for this run

name: Revalidate SWP Mensa Data Cron Job
on:
workflow_dispatch:
# We've only got 1.000 requests per month, so we don't want to run this too often.
# Max 20 Weekdays per month, 1000/20 = 50 requests per weekday
# Mensas are typically open from 8:00 until 15:00 (7 hours)
# 50/7 = 7.14 requests per hour
# We want to run this every 8 minutes between 8:00 and 14:00, only on weekdays
schedule:
- cron: '*/8 8-14 * * 1-5'
jobs:
cron:
runs-on: ubuntu-latest
steps:
- name: Call Revalidation API
run: |
curl --request POST \
--url 'https://bqfzesnwsvziyglfeezk.supabase.co/functions/v1/swpParser' \
--header "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}"