From 55bb044b7deadd1fe5055078274651ce6402589f Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sat, 11 Jul 2026 16:47:37 +0900 Subject: Fix scraper restart loop: MARZ 500 on unpublished month + set -e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新宿MARZ翌月スケジュールのHTTP 500がスクレイパー全体を失敗させ、 set -e によりentrypointがcron起動前に終了→再起動ループを引き起こしていた。 - marz-shinjuku: 404/500は未掲載扱いで空配列を返すよう変更 - scraper-entrypoint.sh: set -e を削除し初回スクレイプ失敗でもcronを起動 Co-Authored-By: Claude Sonnet 4.6 --- app/scrapers/marz-shinjuku.ts | 3 ++- 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 { 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 -- cgit v1.2.3