Release the HTTP sessions

This commit is contained in:
Zahary Karadjov 2022-02-02 19:51:04 +02:00
parent 5a28176080
commit 97ba55bbf6
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609

View File

@ -117,3 +117,7 @@ proc connect*(client: RpcHttpClient, address: string, port: Port, secure: bool)
client.httpAddress = res
else:
raise newException(RpcAddressUnresolvableError, res.error)
method close*(client: RpcHttpClient) {.async.} =
if not client.httpSession.isNil:
await client.httpSession.closeWait()