Refine status check logic when handling document requests in Playwright

This commit is contained in:
2025-10-12 20:17:04 -04:00
parent 39c2c7d37a
commit 5fe7313fa4

View File

@@ -296,10 +296,7 @@ func (b playWrightBrowser) openPage(_ context.Context, target string, opts OpenP
slog.Info("opened document", "url", target, "status", resp.Status(), "request", resp.Request())
if resp.Status() != 200 {
time.Sleep(999 * time.Hour * 24)
time.Sleep(25 * time.Second)
if resp.Status() < 200 || resp.Status() >= 300 {
_ = page.Close()
if resp.Status() == 404 {