mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[GH-ISSUE #95] Feature Request: --cache-dir flag for custom cache database location #21
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#21
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?
Originally created by @Mifody-07 on GitHub (Mar 9, 2026).
Original GitHub issue: https://github.com/Glitchy-Sheep/boosty-downloader/issues/95
Originally assigned to: @Glitchy-Sheep on GitHub.
Feature Request:
--cache-dirflag to specify custom cache database locationThe Story (or: how a simple task turned into patching source code)
I've been using boosty-downloader on my laptop — it worked great. But at some point I decided to move it into a Proxmox LXC container so downloads would run independently in the background while I do other things, without keeping a terminal open on my laptop.
The setup looked reasonable:
post_cache.dbending up on the NAS share too (since it's created next to the output directory)And then this happened:
Why this happens
SQLite is not a server — it's just a file. To prevent data corruption when writing, it uses OS-level file locking: it asks the operating system to lock the file while writing, so nothing else can touch it.
This works perfectly on local filesystems (ext4, btrfs, ntfs).
But CIFS/SMB is a network protocol. When Linux sends a file lock request over CIFS — it goes over the network to the Synology NAS. Synology either ignores it or acknowledges it without actually enforcing it. SQLite believes the lock was acquired, tries to write, and gets a conflict.
Result:
database is locked— even when there's only one process running.Why not just fix the network storage?
The obvious alternatives:
Run boosty-downloader directly on the NAS — Synology DSM is a closed platform. No pip, limited Python, and Synology explicitly warns that data outside shared folders may be deleted on system updates. Not viable.
Use NFS instead of CIFS — NFS supports POSIX file locking properly, SQLite would work. But I already have CIFS shares set up for everything (Windows clients, media players, etc). Reconfiguring the entire storage stack just to fix one SQLite file is overengineering.
Use iSCSI — NAS exposes a block device, container formats it as ext4. SQLite works perfectly. But again — massive overengineering for a single cache file.
Mount cache on tmpfs (RAM) — SQLite works, but cache is lost on every container restart, forcing full re-download every time.
All roads lead to the same conclusion: the cache database needs to be on a local disk, separate from the output directory.
Current workaround
Manually patching
app_environment.py:This works — but it's a hack that breaks on every
pip install --upgrade boosty-downloader.Proposed Solution
Add a
--cache-dirCLI flag and correspondingconfig.yamloption:If
--cache-diris not specified — behavior stays exactly as now (cache next to output). No breaking changes.Who needs this
Anyone running boosty-downloader with output to network storage:
This is not an edge case — it's probably the most common production setup for a tool like this.
I am ready to try implementing this and submit a pull request if you're interested.
@Glitchy-Sheep commented on GitHub (Apr 11, 2026):
Yeah, that's reasonable, I'll make this soon I think
@Glitchy-Sheep commented on GitHub (Apr 12, 2026):
Version 2.2.0 has been released with the feature you described - hope it helps! 🤟