Explorar o código

Remove 24-hour queue item expiration logic

Queue items were being marked as "expired" if older than 24 hours,
which breaks legitimate use cases like weekend print queues or
printers that are offline for extended periods.
maziggy hai 7 meses
pai
achega
b4285913a9
Modificáronse 1 ficheiros con 0 adicións e 12 borrados
  1. 0 12
      backend/app/services/print_scheduler.py

+ 0 - 12
backend/app/services/print_scheduler.py

@@ -76,18 +76,6 @@ class PrintScheduler:
                 if item.scheduled_time and item.scheduled_time > datetime.utcnow():
                     continue
 
-                # Safety: Skip stale items (older than 24 hours) to prevent phantom reprints
-                # This protects against items that got stuck in "pending" status due to
-                # crashes/restarts after the print already started
-                stale_threshold = timedelta(hours=24)
-                if item.created_at and datetime.utcnow() - item.created_at.replace(tzinfo=None) > stale_threshold:
-                    logger.warning(f"Queue item {item.id} is stale (created {item.created_at}), marking as expired")
-                    item.status = "expired"
-                    item.error_message = "Queue item expired - older than 24 hours"
-                    item.completed_at = datetime.utcnow()
-                    await db.commit()
-                    continue
-
                 # Skip items that require manual start
                 if item.manual_start:
                     continue