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:
@@ -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")
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user