File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ enum class BackupCategory(
5050}
5151
5252/* *
53- * @property running In progress
54- * @property synced Timestamp in ms of last time this backup was synced
55- * @property required Timestamp in ms of last time this backup was required
53+ * @property running Backup is currently in progress
54+ * @property synced Timestamp in millis of last time this backup succeeded
55+ * @property required Timestamp in millis of last time the data changed
5656 */
5757@Serializable
5858data class BackupItemStatus (
Original file line number Diff line number Diff line change @@ -50,6 +50,20 @@ import java.util.concurrent.ConcurrentHashMap
5050import javax.inject.Inject
5151import javax.inject.Singleton
5252
53+ /* *
54+ * Manages backup & restore of wallet metadata to a remote VSS server.
55+ *
56+ * **Backup State Machine:**
57+ * ```
58+ * Idle State: running=false, synced≥required
59+ * ↓ (data changes → markBackupRequired())
60+ * Pending State: running=false, synced<required
61+ * ↓ (scheduleBackup())
62+ * Running State: running=true, synced<required
63+ * ↓ (triggerBackup() succeeds)
64+ * Idle State: running=false, synced≥required
65+ * ```
66+ */
5367@Suppress(" LongParameterList" )
5468@Singleton
5569class BackupRepo @Inject constructor(
@@ -72,7 +86,7 @@ class BackupRepo @Inject constructor(
7286 private val dataListenerJobs = mutableListOf<Job >()
7387 private var periodicCheckJob: Job ? = null
7488
75- private val runningBackups = ConcurrentHashMap .newKeySet<BackupCategory >()
89+ private val runningBackups = ConcurrentHashMap .newKeySet<BackupCategory >() // Tracks active jobs since app start
7690
7791 private var isObserving = false
7892 private var lastNotificationTime = 0L
You can’t perform that action at this time.
0 commit comments