mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 21:36:28 +02:00
Closes subscription when finished by timeout.
This commit is contained in:
@@ -49,7 +49,6 @@ fun NostrClient.downloadFirstEvent(
|
|||||||
if (subId == subscriptionId) {
|
if (subId == subscriptionId) {
|
||||||
unsubscribe(this)
|
unsubscribe(this)
|
||||||
close(subscriptionId)
|
close(subscriptionId)
|
||||||
|
|
||||||
onResponse(event)
|
onResponse(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,6 +60,8 @@ fun NostrClient.downloadFirstEvent(
|
|||||||
|
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
delay(30000)
|
delay(30000)
|
||||||
|
|
||||||
|
close(subscriptionId)
|
||||||
unsubscribe(listener)
|
unsubscribe(listener)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user