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

feat: add in a timeout option #253

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

Conversation

akhilnarang
Copy link

Resolves #252

pdfkit/pdfkit.py Outdated
Comment on lines 191 to 197
kwargs = {"input": input}

# Check if a timeout was specified and pass it along if so
if self.timeout:
kwargs["timeout"] = self.timeout

stdout, stderr = result.communicate(**kwargs)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kwargs = {"input": input}
# Check if a timeout was specified and pass it along if so
if self.timeout:
kwargs["timeout"] = self.timeout
stdout, stderr = result.communicate(**kwargs)
stdout, stderr = result.communicate(input=input, timeout=timeout)

This should work too?

Copy link
Author

@akhilnarang akhilnarang Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep works, can't remember exactly why I had wanted to avoid passing a None value.
However the default value for timeout is None, so definitely makes sense to just do this.

Signed-off-by: Akhil Narang <[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.

feature request - support specifying timeout for pdf generation
2 participants