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

Merged

Conversation

arhen
Copy link
Contributor

@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.

@davidteather davidteather changed the base branch from main to v6.6.0 January 21, 2025 04:12
@davidteather
Copy link
Owner

Thank you! Merging, going to reduce the timeout to 30s though

@davidteather davidteather merged commit 77f4e4e into davidteather:v6.6.0 Jan 21, 2025
davidteather added a commit that referenced this pull request Jan 21, 2025
…ing (#1215)

* fix: unable to find byted acrawler
* fix: playwright timeout sessions with provide opt-out params when creating sessions (#1196)
* timeout: 300s -> 30s
* fix: tiktok returned invalid reponse by bot detection (#1197)
* chore: move wait for load state between mouse moves
* Update docstring for create_session() (#1202)
* Add playlist class (#1207)
* feat: add playlist class
* bump version, fix tests

---------

Co-authored-by: Rahmat Slamet <[email protected]>
Co-authored-by: brandon <[email protected]>
Co-authored-by: Lukas <[email protected]>
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.

3 participants