Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ internal class SettingsViewModel @Inject constructor(
}

fun scheduleConfigUpdate() {
syncOrchestrator.startProjectSync()
syncOrchestrator.startDeviceSync()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class SettingsViewModelTest {
fun `trigger device sync when called`() {
viewModel.scheduleConfigUpdate()

verify { syncOrchestrator.startProjectSync() }
verify { syncOrchestrator.startDeviceSync() }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface SyncOrchestrator {
suspend fun scheduleBackgroundWork()
suspend fun cancelBackgroundWork()

fun startProjectSync()
fun startDeviceSync()

fun rescheduleEventSync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ internal class SyncOrchestratorImpl @Inject constructor(
stopEventSync()
}

override fun startProjectSync() {
workManager.startWorker<ProjectConfigDownSyncWorker>(SyncConstants.PROJECT_SYNC_WORK_NAME)
}

override fun startDeviceSync() {
workManager.startWorker<DeviceConfigDownSyncWorker>(SyncConstants.DEVICE_SYNC_WORK_NAME_ONE_TIME)
}
Expand Down