CacheWorker: Check if old download directories exists

Silences logspam

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-11-14 12:46:41 +03:00
parent e35f716e14
commit 7e4554ae61

View File

@@ -58,9 +58,9 @@ class CacheWorker @AssistedInject constructor(
override suspend fun doWork(): Result {
Log.i(TAG, "Cleaning cache")
PathUtil.getOldDownloadDirectories(appContext).forEach { downloadDir -> // Downloads
Log.i(TAG, "Deleting old unused download directory: $downloadDir")
downloadDir.deleteRecursively()
PathUtil.getOldDownloadDirectories(appContext).filter { it.exists() }.forEach { dir -> // Downloads
Log.i(TAG, "Deleting old unused download directory: $dir")
dir.deleteRecursively()
}
PathUtil.getDownloadDirectory(appContext).listFiles()?.forEach { download -> // com.example.app