Bump global timeout to two minutes

Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
This commit is contained in:
Alex Pyrgiotis 2022-11-23 13:09:26 +02:00
parent 1f18f77b64
commit 57fdf06f0f
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -24,7 +24,10 @@ import magic
from PIL import Image from PIL import Image
# timeout in seconds for any single subprocess # timeout in seconds for any single subprocess
DEFAULT_TIMEOUT: float = 60 DEFAULT_TIMEOUT: float = 120
# timeout in seconds for compressing a single page of the final document
COMPRESSION_TIMEOUT: float = 10
def run_command( def run_command(
@ -339,7 +342,7 @@ class DangerzoneConverter:
# Compress # Compress
self.update_progress("Compressing PDF") self.update_progress("Compressing PDF")
compress_timeout = num_pages * 3 compress_timeout = num_pages * COMPRESSION_TIMEOUT
run_command( run_command(
["ps2pdf", "/tmp/safe-output.pdf", "/tmp/safe-output-compressed.pdf"], ["ps2pdf", "/tmp/safe-output.pdf", "/tmp/safe-output-compressed.pdf"],
timeout_message=f"Error compressing PDF, ps2pdf timed out after {compress_timeout} seconds", timeout_message=f"Error compressing PDF, ps2pdf timed out after {compress_timeout} seconds",