Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: playwright timeout sessions with provide opt-out params #1196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arhen
Copy link

@arhen arhen commented Sep 22, 2024

So, this PR is to provide opt-out solution for issues; #1185 and #994

PROBLEMS

when I try to figure out what is happening, most of the time the sessions is not long enough to handle the navigation process. This issue appear due to some problems such as; lack of resources when run the script, too much sessions to handle (ex: run alot of script once in a time), and another process block the session to finish.

SOLUTION

By default, playwright timeout sessions is 3000ms == 30 seconds. For those problems above, this default timeouts is not enough. So with opt-out the timeout params via creating session , we can override default playwright timeout sessions before navigation started.

IMPLEMENTATION

This PR basically adding opt-out params when creating session. ex:

await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, timeout=60000)

this will let playwirght session started with 60secs timeout instead of 30s by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant