Skip to content
Snippets Groups Projects
Commit 25decc60 authored by Kamal Bramwell's avatar Kamal Bramwell
Browse files

Clean up logic to show this action only runs once per call

Since a flow could be perceived as a continuous action, the take(1) function communicates this only runs once on the first set of results, then cancels itself.
parent b9aadcd5
No related branches found
No related tags found
3 merge requests!84Version 2.92 build 629,!77v2.9 b627,!74FE-957: Requests stuck verifying
...@@ -121,13 +121,12 @@ class ContactRequestsRepository @Inject constructor( ...@@ -121,13 +121,12 @@ class ContactRequestsRepository @Inject constructor(
override fun failUnverifiedRequests() { override fun failUnverifiedRequests() {
scope.launch { scope.launch {
getRequests().cancellable().collect { requests -> getRequests().take(1).collect { requests ->
requests.filter { requests.filter {
it.requestStatus == VERIFYING it.requestStatus == VERIFYING
}.forEach { }.forEach {
update(it, VERIFICATION_FAIL) update(it, VERIFICATION_FAIL)
} }
this.coroutineContext.job.cancel()
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment