Merge pull request #1508 from greenart7c3/main
Fix sendAndWaitForResponse never receiving a response
This commit is contained in:
+1
-2
@@ -95,6 +95,7 @@ suspend fun INostrClient.sendAndWaitForResponse(
|
||||
val receivedResults = mutableMapOf<NormalizedRelayUrl, Boolean>()
|
||||
// The withTimeout block will cancel the coroutine if the loop takes too long
|
||||
withTimeoutOrNull(timeoutInSeconds * 1000) {
|
||||
send(event, relayList)
|
||||
while (receivedResults.size < relayList.size) {
|
||||
val result = resultChannel.receive()
|
||||
|
||||
@@ -109,8 +110,6 @@ suspend fun INostrClient.sendAndWaitForResponse(
|
||||
}
|
||||
}
|
||||
|
||||
send(event, relayList)
|
||||
|
||||
val receivedResults = resultSubscription.await()
|
||||
|
||||
unsubscribe(subscription)
|
||||
|
||||
Reference in New Issue
Block a user