diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-07-11 16:47:37 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-07-11 16:47:37 +0900 |
| commit | 55bb044b7deadd1fe5055078274651ce6402589f (patch) | |
| tree | 8269b820b47261398a08b857b937bf8b9219faa6 | |
| parent | 44f9ef0d9caa0d9cce06635f6c0c7e045fef2796 (diff) | |
Fix scraper restart loop: MARZ 500 on unpublished month + set -e
新宿MARZ翌月スケジュールのHTTP 500がスクレイパー全体を失敗させ、
set -e によりentrypointがcron起動前に終了→再起動ループを引き起こしていた。
- marz-shinjuku: 404/500は未掲載扱いで空配列を返すよう変更
- scraper-entrypoint.sh: set -e を削除し初回スクレイプ失敗でもcronを起動
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | app/scrapers/marz-shinjuku.ts | 3 | ||||
| -rw-r--r-- | scripts/scraper-entrypoint.sh | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/scrapers/marz-shinjuku.ts b/app/scrapers/marz-shinjuku.ts index 06c0bcc..b03f23c 100644 --- a/app/scrapers/marz-shinjuku.ts +++ b/app/scrapers/marz-shinjuku.ts @@ -26,7 +26,8 @@ export const venue: VenueMeta = { async function scrapeMonth(year: number, month: number): Promise<EventInput[]> { const url = `http://www.marz.jp/schedule/${year}/${String(month).padStart(2, "0")}/`; const res = await fetch(url); - if (!res.ok) throw new Error(`HTTP ${res.status} for ${url}`); + // 404/500 = schedule not yet published for that month + if (!res.ok) return []; const $ = cheerio.load(await res.text()); const events: EventInput[] = []; diff --git a/scripts/scraper-entrypoint.sh b/scripts/scraper-entrypoint.sh index 87bc0c8..6443de4 100644 --- a/scripts/scraper-entrypoint.sh +++ b/scripts/scraper-entrypoint.sh @@ -1,6 +1,5 @@ #!/bin/sh -set -e -node --import tsx/esm scripts/scrape.ts +node --import tsx/esm scripts/scrape.ts || echo "[entrypoint] initial scrape failed (exit $?), cron will retry" exec cron -f |
