mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 19:21:33 +02:00
Two-part root cause for missing photos/filament/cost on large prints (#972). The configured ftp_timeout was only plumbed through as the FTP socket timeout; the asyncio.wait_for wrapping run_in_executor stayed on its 60s hardcoded default, so the user's 300s setting never applied. Worse, asyncio.wait_for cannot cancel run_in_executor threads — after the 60s outer timeout fired, the executor thread kept running ftplib.retrbinary and frequently completed the download ~30–60s later, but by then the async wrapper had returned False. with_ftp_retry kept re-attempting the same path, each retry truncating the file the zombie thread had just written, and the archive was ultimately persisted as a fallback with no 3MF. download_file_async now accepts timeout at each call site (plumbed from ftp_timeout) and salvages post-timeout success via an explicit completion flag the executor thread sets only after download_to_file returns True. Per-attempt completion dict so a prot_p zombie can't flip the flag for a later prot_c attempt. A cosmetic // prefix in the directory-search download path is also fixed by replacing string concatenation with posixpath.join.