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();
+2 -2
View File
@@ -89,8 +89,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "15f517c0df110a922ca1747d5b01989c7fbe95aa"
resolved-ref: "15f517c0df110a922ca1747d5b01989c7fbe95aa"
ref: "4c965996210e408465e3c8b66e63ab4a659a62f9"
resolved-ref: "4c965996210e408465e3c8b66e63ab4a659a62f9"
url: "https://github.com/edde746/background_downloader"
source: git
version: "9.5.4"
+1 -1
View File
@@ -55,7 +55,7 @@ dependencies:
background_downloader:
git:
url: https://github.com/edde746/background_downloader
ref: 15f517c0df110a922ca1747d5b01989c7fbe95aa
ref: 4c965996210e408465e3c8b66e63ab4a659a62f9
sentry_flutter:
git:
url: https://github.com/edde746/sentry-dart