changed method of fetching crontab schedule

This commit is contained in:
Ebbe Baß
2026-09-09 11:40:35 +02:00
parent eaed7d4ce6
commit 5d9b3a6070
4 changed files with 87 additions and 12 deletions
+9 -3
View File
@@ -17,7 +17,7 @@ from fastapi.responses import PlainTextResponse
from calendar_feed import build_ics
from datasource import EventStore, iter_artist_names, parse_event_date
from models import Event, EventList
from scrape_schedule import get_schedule_info
from scrape_schedule import discover_cron_expr, get_schedule_info
app = FastAPI(
title="Fundi Scraper API",
@@ -59,8 +59,14 @@ def _matches(
@app.get("/health")
def health():
scrape_cron = os.environ.get("SCRAPE_CRON")
archive_scrape_cron = os.environ.get("ARCHIVE_SCRAPE_CRON") or scrape_cron
scrape_cron = os.environ.get("SCRAPE_CRON") or discover_cron_expr(
"scraper.py", archive=False
)
archive_scrape_cron = (
os.environ.get("ARCHIVE_SCRAPE_CRON")
or discover_cron_expr("scraper.py", archive=True)
or scrape_cron
)
return {
"status": "ok",
"events_loaded": len(store.all()),