mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[PR #295] [MERGED] bug/spoolman-creates-dublicate-spools #991
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#991
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/295
Author: @bambuman
Created: 2/7/2026
Status: ✅ Merged
Merged: 2/8/2026
Merged by: @maziggy
Base:
0.1.9b← Head:bug/spoolman-creates-dublicate-spools📝 Commits (2)
deab812Optimize AMS Spoolman sync performance with spool cachingc04df8cAdd retry logic and connection resilience to Spoolman sync📊 Changes
4 files changed (+378 additions, -24 deletions)
View changed files
📝
backend/app/api/routes/spoolman.py(+54 -4)📝
backend/app/main.py(+32 -1)📝
backend/app/services/spoolman.py(+89 -18)📝
backend/tests/unit/services/test_spoolman_service.py(+203 -1)📄 Description
Description
This error creates duplicate spool's (see screenshot) on application start. Haven't seen on other occasions.
This PR Optimizes AMS-to-Spoolman sync performance and adds connection resilience for large spool databases (300+ spools).
Problem: Each AMS tray independently fetched all spools from Spoolman, causing redundant API calls per sync operation. This caused timeouts and poor performance with large spool databases.
Solution: Fetch all spools once and reuse cached data across all tray operations. Added retry logic (3 attempts, 500ms delay) with connection recreation to handle transient network errors, ensuring the optimization remains reliable.
Related Issue
Type of Change
Changes Made
cached_spoolsparameter to sync functions (backward compatible)on_ams_change,sync_single_printer, andsync_all_printersget_spools()with connection recreation on errorshttpx.Limitsto prevent stale connection reuseScreenshots
Testing
Test Environment:
Checklist
Additional Notes
Future improvement: The ideal solution would be enhancing Spoolman's API to support querying by extra data/tag, eliminating the need for client-side caching. Spoolman has a new release and appears actively maintained again, making this a viable contribution opportunity. I'll look into that.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.