mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
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:
parent
1f18f77b64
commit
57fdf06f0f
1 changed files with 5 additions and 2 deletions
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue