mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 01:57:41 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user