Created
August 4, 2022 09:43
-
-
Save molidev8/f9a63944ede7b6e7e14d0628fe3887ac to your computer and use it in GitHub Desktop.
Specifiying the worker job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BackupWorker( | |
context: Context, | |
workerParams: WorkerParameters | |
) : CoroutineWorker(context, workerParams) { | |
private val backup: BackupUserData = BackupUserData(applicationContext) | |
override suspend fun doWork(): Result { | |
return if (backup.doBackup()) Result.success() | |
else Result.failure() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment