fix : crawlYoutubeVerify 우분투 환경 Puppeteer 샌드박스 옵션 추가#162
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review Summary by QodoAdd Puppeteer sandbox options for Ubuntu environment
WalkthroughsDescription• Add Puppeteer sandbox options for Ubuntu environment compatibility • Configure headless mode and disable sandbox/setuid-sandbox for action environment Diagramflowchart LR
A["puppeteer.launch()"] -- "add sandbox options" --> B["puppeteer.launch with args"]
B -- "headless: true" --> C["Headless mode enabled"]
B -- "no-sandbox flag" --> D["Sandbox disabled"]
B -- "disable-setuid-sandbox" --> E["Setuid sandbox disabled"]
File Changes1. packages/crawling/src/crawling/crawlYoutubeVerify.ts
|
Code Review by Qodo
1. Browser not closed safely
|
| // action 우분투 환경에서의 호환을 위해 추가 | ||
| const browser = await puppeteer.launch({ | ||
| headless: true, | ||
| args: ['--no-sandbox', '--disable-setuid-sandbox'], | ||
| }); |
There was a problem hiding this comment.
1. Browser not closed safely 🐞 Bug ⛯ Reliability
crawlYoutubeVerify launches a Browser at module scope without a try/finally, and it calls browser.close() without awaiting it, so any thrown error can bypass cleanup and leave Chromium running. This can hang or flake CI runs because Supabase getters can throw before the close is reached.
Agent Prompt
### Issue description
`crawlYoutubeVerify.ts` does not guarantee Puppeteer cleanup: it launches `browser` at module scope, has no `try/finally`, and calls `browser.close()` without `await`. Any thrown error (e.g., from Supabase getters) can skip cleanup and leave Chromium running.
### Issue Context
Supabase getter functions used in this script throw on error, so lifecycle cleanup must be guaranteed.
### Fix Focus Areas
- packages/crawling/src/crawling/crawlYoutubeVerify.ts[12-50]
### Implementation notes
- Wrap the whole script body in `const main = async () => { ... }`.
- Use `try { ... } catch (e) { ... } finally { await browser.close(); }`.
- Consider moving `page` creation inside the `try` and setting a non-zero `process.exitCode` on fatal errors.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
📌 PR 제목
[Type] : 작업 내용 요약
📌 변경 사항
💬 추가 참고 사항