Fix WorkManager cancellation issues

This commit is contained in:
Jobobby04
2024-06-01 17:46:42 -04:00
parent 8df0446020
commit 7e6811692e
3 changed files with 4 additions and 4 deletions
@@ -61,14 +61,14 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
override suspend fun doWork(): Result {
return try {
if (requiresWifiConnection(preferences) && !context.isConnectedToWifi()) {
Result.failure()
Result.success() // retry again later
} else {
startUpdating()
logger.d("Update job completed!")
Result.success()
}
} catch (e: Exception) {
Result.failure()
Result.success() // retry again later
}
}