-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
GitHubWorkerMigration
and bump version to "4.4.2" (142)
- Loading branch information
1 parent
e6e001e
commit c9a985e
Showing
4 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/ivy/wallet/migrations/impl/GitHubWorkerMigration.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.ivy.wallet.migrations.impl | ||
|
||
import com.ivy.wallet.backup.github.GitHubAutoBackupManager | ||
import com.ivy.wallet.backup.github.GitHubBackup | ||
import com.ivy.wallet.migrations.Migration | ||
import kotlinx.coroutines.flow.firstOrNull | ||
import timber.log.Timber | ||
import javax.inject.Inject | ||
|
||
class GitHubWorkerMigration @Inject constructor( | ||
private val gitHubBackup: GitHubBackup, | ||
private val gitHubAutoBackupManager: GitHubAutoBackupManager, | ||
) : Migration { | ||
override val key: String | ||
get() = "github_auto_backup_worker_v1" | ||
|
||
override suspend fun migrate() { | ||
if (gitHubBackup.enabled.firstOrNull() == true) { | ||
gitHubAutoBackupManager.scheduleAutoBackups() | ||
Timber.i("GitHub auto-backups worker rescheduled.") | ||
} | ||
} | ||
} |
This file contains 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