Refine status check logic when handling document requests in Playwright
This commit is contained in:
@@ -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())
|
slog.Info("opened document", "url", target, "status", resp.Status(), "request", resp.Request())
|
||||||
|
|
||||||
if resp.Status() != 200 {
|
if resp.Status() < 200 || resp.Status() >= 300 {
|
||||||
time.Sleep(999 * time.Hour * 24)
|
|
||||||
time.Sleep(25 * time.Second)
|
|
||||||
|
|
||||||
_ = page.Close()
|
_ = page.Close()
|
||||||
|
|
||||||
if resp.Status() == 404 {
|
if resp.Status() == 404 {
|
||||||
|
Reference in New Issue
Block a user