When restarting client, also "restart" tokio runtime (#1065)

* remember new tokio runtime on reconnect

* compilation
This commit is contained in:
Svyatoslav Nikolsky authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent 63d6fc436a
commit 09d30894d1
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -76,7 +76,9 @@ impl Client {
/// Reopen client connection.
pub async fn reconnect(&mut self) -> Result<()> {
self.client = Self::build_client(&self.params).await?.1;
let (tokio, client) = Self::build_client(&self.params).await?;
self.tokio = tokio;
self.client = client;
Ok(())
}
}
@@ -125,7 +125,9 @@ impl<C: Chain> Client<C> {
/// Reopen client connection.
pub async fn reconnect(&mut self) -> Result<()> {
self.client = Self::build_client(self.params.clone()).await?.1;
let (tokio, client) = Self::build_client(self.params.clone()).await?;
self.tokio = tokio;
self.client = client;
Ok(())
}