summaryrefslogtreecommitdiffhomepage
path: root/talpid-core/src
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-07-08 15:38:42 +0200
committerDavid Lönnhager <david.l@mullvad.net>2021-07-13 15:57:37 +0200
commite52236b751a0d4a3ae9de9b6ba5569ef3faff495 (patch)
tree0db878501636ebdd4cecb9732d440852d2cbd5e7 /talpid-core/src
parent66a994935c165ef7899ca31c1c1714471bb26ca8 (diff)
downloadmullvadvpn-e52236b751a0d4a3ae9de9b6ba5569ef3faff495.tar.xz
mullvadvpn-e52236b751a0d4a3ae9de9b6ba5569ef3faff495.zip
Fix tokio runtime builders
Diffstat (limited to 'talpid-core/src')
-rw-r--r--talpid-core/src/routing/linux.rs4
-rw-r--r--talpid-core/src/tunnel/openvpn/mod.rs5
2 files changed, 4 insertions, 5 deletions
diff --git a/talpid-core/src/routing/linux.rs b/talpid-core/src/routing/linux.rs
index a63430fed3..6dc5489de3 100644
--- a/talpid-core/src/routing/linux.rs
+++ b/talpid-core/src/routing/linux.rs
@@ -826,7 +826,7 @@ mod test {
/// Tests if dropping inside a tokio runtime panics
#[test]
fn test_drop_in_executor() {
- let mut runtime = tokio::runtime::Runtime::new().expect("Failed to initialize runtime");
+ let runtime = tokio::runtime::Runtime::new().expect("Failed to initialize runtime");
runtime.block_on(async {
let manager = RouteManagerImpl::new(HashSet::new())
.await
@@ -838,7 +838,7 @@ mod test {
/// Tests if dropping outside a runtime panics
#[test]
fn test_drop() {
- let mut runtime = tokio::runtime::Runtime::new().expect("Failed to initialize runtime");
+ let runtime = tokio::runtime::Runtime::new().expect("Failed to initialize runtime");
let manager = runtime.block_on(async {
RouteManagerImpl::new(HashSet::new())
.await
diff --git a/talpid-core/src/tunnel/openvpn/mod.rs b/talpid-core/src/tunnel/openvpn/mod.rs
index f25f2624da..3bdbf3ff30 100644
--- a/talpid-core/src/tunnel/openvpn/mod.rs
+++ b/talpid-core/src/tunnel/openvpn/mod.rs
@@ -528,9 +528,8 @@ impl<C: OpenVpnBuilder + Send + 'static> OpenVpnMonitor<C> {
format!("/tmp/talpid-openvpn-{}", uuid)
};
- let mut runtime = tokio::runtime::Builder::new()
- .threaded_scheduler()
- .core_threads(1)
+ let runtime = tokio::runtime::Builder::new_multi_thread()
+ .worker_threads(1)
.enable_all()
.build()
.map_err(Error::RuntimeError)?;