Skip to content

Commit

Permalink
[PM-14346] Run alias generation on the IO dispatcher (#4215)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8f2d55c)
  • Loading branch information
SaintPatrck committed Nov 1, 2024
1 parent 9f8d21c commit 5523d99
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.receiveAsFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.time.Clock
import javax.inject.Singleton

Expand Down Expand Up @@ -190,7 +191,7 @@ class GeneratorRepositoryImpl(

override suspend fun generateForwardedServiceUsername(
forwardedServiceGeneratorRequest: UsernameGeneratorRequest.Forwarded,
): GeneratedForwardedServiceUsernameResult =
): GeneratedForwardedServiceUsernameResult = withContext(scope.coroutineContext) {
generatorSdkSource.generateForwardedServiceEmail(forwardedServiceGeneratorRequest)
.fold(
onSuccess = { generatedEmail ->
Expand All @@ -200,6 +201,7 @@ class GeneratorRepositoryImpl(
GeneratedForwardedServiceUsernameResult.InvalidRequest(it.message)
},
)
}

override fun getPasscodeGenerationOptions(): PasscodeGenerationOptions? {
val userId = authDiskSource.userState?.activeUserId
Expand Down

0 comments on commit 5523d99

Please sign in to comment.