fix(downloads): clean orphaned temp files

close #1040
This commit is contained in:
edde746
2026-05-14 09:05:06 +02:00
parent 5a46857035
commit 7b4a37e576
3 changed files with 8 additions and 3 deletions
@@ -427,6 +427,11 @@ class DownloadManagerService {
unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Initializing FileDownloader', category: 'downloads')));
await _initializeFileDownloader();
final deletedTempFiles = await FileDownloader().cleanUpOrphanedTempFiles();
if (deletedTempFiles > 0) {
appLogger.i('Deleted $deletedTempFiles orphaned downloader temp file(s)');
}
// Let background_downloader re-enqueue tasks killed by the OS
unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Rescheduling killed tasks', category: 'downloads')));
final (rescheduled, _) = await FileDownloader().rescheduleKilledTasks();