From 935344d581d25cbf991c4a2f967d14de583c43f0 Mon Sep 17 00:00:00 2001 From: zman Date: Mon, 7 Apr 2025 17:29:54 -0400 Subject: [PATCH] f --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index fbe6d03..f35c36a 100644 --- a/app.py +++ b/app.py @@ -80,18 +80,18 @@ def print_address_label(pdf_path): cut=True ) - # Try to acquire the printer lock with a timeout + # Try to acquire the printer lock with a longer timeout max_retries = 3 - retry_delay = 2 # seconds + retry_delay = 10 # 10 seconds retry delay for attempt in range(max_retries): - if printer_lock.acquire(timeout=5): # 5 seconds timeout + if printer_lock.acquire(timeout=30): # 30 seconds timeout to allow more time for the printer try: app.logger.info(f"Attempting to send print job (Attempt {attempt + 1})...") send( instructions=instructions, printer_identifier=printer, backend_identifier=backend, - blocking=True + blocking=True # Ensure blocking, so we wait for the print to complete ) app.logger.info("Print job sent successfully") break