Skip to content

feat: add in a timeout option - #253

Open
akhilnarang wants to merge 1 commit into
JazzCore:masterfrom
akhilnarang:add-timeout-option
Open

feat: add in a timeout option#253
akhilnarang wants to merge 1 commit into
JazzCore:masterfrom
akhilnarang:add-timeout-option

Conversation

@akhilnarang

Copy link
Copy Markdown

Resolves #252

Comment thread 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
Copy Markdown

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?

@akhilnarang akhilnarang Oct 26, 2023

Copy link
Copy Markdown
Author

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 <me@akhilnarang.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants