CleanCacheWorker: Don't allow configuring cache duration

6 hours is ample time to do anything a user would like to do

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-05-31 13:45:47 +05:30
parent 687a7c1540
commit fc6c5b0307
23 changed files with 2 additions and 59 deletions

View File

@@ -9,8 +9,6 @@ import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.WorkerParameters
import com.aurora.store.util.PathUtil
import com.aurora.store.util.Preferences
import com.aurora.store.util.Preferences.PREFERENCE_DOWNLOADS_CACHE_TIME
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
import java.io.File
@@ -44,9 +42,7 @@ class CleanCacheWorker @AssistedInject constructor(
}
}
private val cacheDuration = Preferences.getInteger(appContext, PREFERENCE_DOWNLOADS_CACHE_TIME, 6)
.toLong()
.toDuration(DurationUnit.HOURS)
private val cacheDuration = 6.toDuration(DurationUnit.HOURS)
override suspend fun doWork(): Result {
Log.i(TAG, "Cleaning cache")

View File

@@ -43,7 +43,6 @@ object Preferences {
const val PREFERENCE_FILTER_SEARCH = "PREFERENCE_FILTER_SEARCH"
const val PREFERENCE_FILTER_AURORA_ONLY = "PREFERENCE_FILTER_AURORA_ONLY"
const val PREFERENCE_DOWNLOADS_CACHE_TIME = "PREFERENCE_DOWNLOADS_CACHE_TIME"
const val PREFERENCE_AUTO_DELETE = "PREFERENCE_AUTO_DELETE"
const val PREFERENCE_INSTALLATION_DEVICE_OWNER = "PREFERENCE_INSTALLATION_DEVICE_OWNER"